Questions tagged [simulink]

Simulink® is an environment developed by The MathWorks for multidomain simulation and Model-Based Design for dynamic and embedded systems.

Simulink® is an environment developed by The MathWorks for multidomain simulation and Model-Based Design for dynamic and embedded systems. It provides an interactive graphical environment and a customizable set of block libraries that let you design, simulate, implement, and test a variety of time-varying systems, including communications, controls, signal processing, video processing, and image processing.

Some useful links:

2873 questions
0
votes
0 answers

How to compile/link generated C code from Simulink

I have a generated .zip file that contains generated C code from a Simulink model. The goal is to compile this code in a shared library that I can use from a .NET Core backend. I have to compile it for both Windows as Unix systems because most of…
JC97
  • 1,530
  • 2
  • 23
  • 44
0
votes
1 answer

Simulink Stateflow: Wait for Parallel States

I would like to create a state machine in Stateflow that enters into multiple parallel states (A&B&C) and then exits to an end state (D) only when a condition from each parallel state has been achieved. The picture demonstrated below exits when…
Jordan McBain
  • 275
  • 2
  • 11
0
votes
0 answers

How to charge a battery model by sun irradiance model?

I am new at modeling. I created a mathematical model via some equations to calculate sun irradiance. The last function does it but I couldn't connect the output (pin) to the battery to charge. What should I do ? Heard just that I needed to add a…
sametsokel
  • 334
  • 3
  • 11
0
votes
1 answer

How can I save .mat data from twincat?

I am using the below model for real-time control with twincat. I cannot get the .mat file in the folder. In the twincat environment, I have linked the object to the tcextendedfilewriter. I can obtain data from the workspace, but I cannot save data…
Eric
  • 1
0
votes
1 answer

How to set parameters in Scilab blocks from SciPad?

I don't know if anyone faced the same problem! In MATLAB, we can easily set the parameters of Simulink blocks from m-files. For example, we can change the coefficients of transfer functions, PID gains, step-input magnitude, simulation time, etc. In…
Sitra
  • 3
  • 2
0
votes
1 answer

How to use structure as parmeter for simulink subsystem and use fields inside as block parameters?

I have created a subsystem in Simulink. I would like this subsystem to have a single parameter, which is supposed to be a Matlab structure. Inside the subsystem, I would then like parameters of some of the blocks to be the fields of this…
crobar
  • 2,810
  • 4
  • 28
  • 46
0
votes
1 answer

How to offset a time value in Simulink?

I've been trying to calc dy/dt= 2y/t, y(1)=1 on Simulink. I adjusted the IC=1 on the integrator but of no avail as it keeps throwing me an error "divisibilty by 0" . I just need to offset t=0 in the equation and run from t>0. How do I? My model
0
votes
1 answer

I modelled the sun in R, but can't do the same in Simulink

I'm very new in modeling systems. With a friend's help, We created this model in R hours <- seq(6+20/60, 18+31/60, 0.01) h_radians <- (pi/12) * (hours - (12+26/60)) doy <- 268 decl_radians <- 23.45 * sin(2*pi*(284+doy)/365) * pi /…
sametsokel
  • 334
  • 3
  • 11
0
votes
1 answer

Use keyboard as Simulink 3D Joystick?

Is it possible to use the keyboard instead of the joystick or the spacemouse block in simulink ? Thank you
Julio Guerra
  • 5,523
  • 9
  • 51
  • 75
0
votes
1 answer

Manage HTTP response (uint_8 decimal vector) and use http parser to read JSON values

I am working in Simulink on a TCP connection between client (my computer) and server. Through standard Ethernet blocks, I send an HTTP request like the following: GET /status HTTP/1.1 Host:... Accept: application/json To send it, I convert it with…
nick_bl
  • 23
  • 2
0
votes
1 answer

Flip sign of fixed point signal without using gain block Simulink

I have an incoming signal and I want to change it's sign. I can easily add a gain block (=-1) and flip the sign or multiply the signal by -1. However, I want to avoid this because the incoming signal is fixdt(1,24,39) which is very small.…
0
votes
1 answer

how to isolate a part of car model in simulink

I have a simulink car model which includes different part of a car obviously (subsystems):). I want to isolate a part of this model, for example, brakes, and feed in dummy variable as inputs. My problem is that this model has few bus selector and…
user531225
  • 1,499
  • 4
  • 12
  • 15
0
votes
1 answer

Matlab Simulink file run time in hours: Relation between step size and simulation/stop time

I intend to run a Matlab Simulink model (of 400 ODEs i.e. 400 ODE models) with a fixed step size of 200e-06 and a simulation/stop time of 52 hours. As per my understanding, the Simulink stop time unit is in seconds. Does it mean that I need to run…
0
votes
1 answer

multiple triggered subsystem + algebraic loop, initialisation problem

I have a Simulink diagram which contains multiple triggered subsystem with different timestamp. In this model I also got a feedback loop inducing an algebraic loop. Therefore the signal must be initialised, in order to do that, I used a Memory…
Chewbaka
  • 184
  • 10
0
votes
0 answers

Using Simulink.Breakpoint for lookup tables in Simulink

I am trying to use Simulink.Breakpoint in lookup tables in Simulink. Here is how I define the lookup table. test_lut = Simulink.LookupTable; test_lut.Table.DataType = 'single'; test_lut.Table.Value = single([1 2 3 4…
Suchendra
  • 1
  • 1