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
3
votes
1 answer

Replicating "Timespan" of sim's backwards compatible syntax

TLDR: In short, what's the best way to rewrite time = 0:0.1:10; [T,X,Y] = sim('model',time) in the "modern" Simulink syntax that doesn't take an explicit time input? It appears I'm rather out of date w.r.t. my Simulink usage. The "current" syntax…
Will Robertson
  • 62,540
  • 32
  • 99
  • 117
3
votes
2 answers

Simulink - Output 1 every 30 seconds, 0 otherwise

I need a subsystem that needs to output 1 at interval or 30 seconds or slightly over 30 seconds. Written in matlab code it should work like that function y = fcn(time,uplinkTimeInterval) %#codegen persistent lastTriggerTime if…
Bruno
  • 632
  • 3
  • 10
  • 24
3
votes
2 answers

LINK : fatal error LNK1104: cannot open file 'ucrt.lib'

Currently I am building a model for Simulink Real-Time and have Microsoft Visual C++ Compilers Community 2015 as my compiler for Simulink Real-Time. When I try to build my model it gives the following error: ### Linking ... link.exe /nologo…
3
votes
0 answers

Efficiently update MATLAB App Designer GUI real time from Simulink

I have a Simulink model and a GUI made in app designer from which I control said model. So far I have been able to let the GUI and the Simulink model communicate both ways. The GUI sets parameter constant blocks in the model using set_param whereas…
Nick
  • 2,862
  • 5
  • 34
  • 68
3
votes
1 answer

How can the output of a Simulink block be fed back as an input?

I have 2 embedded Matlab functions which I am using to create a Simulink model. Both functions use the output of the second function as their input. I am getting an error at the moment indicating that this is an invalid loop. Does anyone know how to…
lmirosevic
  • 15,787
  • 13
  • 70
  • 116
3
votes
1 answer

How to get the order of Simulink blocks based on their pin connection?

For Example: From attached Simulink model figure (This model has no meaning. created only to give idea about my problem ), I want to get the order of blocks based on pin connection instead of their alphabetic order. The order should be like…
Ganesh H
  • 45
  • 6
3
votes
1 answer

Heterogeneous data from workspace into Simulink

I have different matrices to import into a Simulink Matlab function from the workspace. These matrices have all different dimension, which I don´t know at priori. At the beginning I tried using the block 'constant' putting the data all together in a…
Betelgeuse
  • 682
  • 2
  • 8
  • 27
3
votes
1 answer

Editing the Code of a "MATLAB Function" Block in Simulink Programmatically

I'd like to create a simple Simulink model containing a "MATLAB Function" block programmatically -- i.e. using Matlab code. Thanks to this guide, I've managed to create a new model containing the…
maddouri
  • 3,737
  • 5
  • 29
  • 51
3
votes
1 answer

Delay interfacing Arduino and Simulink

I am trying to read data from potentionmeter using an arduino microcontroller (tried both arduino UNO, arduino FIO) and using serial communication interface it to Simulink (I tried baud rates ranging from 57600-921600). Here is the Arduino source…
3
votes
1 answer

handing string to MATLAB function in Simulink

In my Simulink Model I have a MATLAB function, this_function, which uses as one parameter the name of the Simulink Model, modelname. The name is defined in an extra parameter file with all other parameters needed. Loading the parameter file loads…
fukurai
  • 104
  • 1
  • 1
  • 9
3
votes
2 answers

Why does Simulink start from a nonzero value?

I'm doing some simulations for control systems. I've noticed that the start time is not zero, even though in the parameters of simulation, the start time is set to zero. For example, in the following diagram, The output of the signal is with…
CroCo
  • 5,531
  • 9
  • 56
  • 88
3
votes
1 answer

Does Simulink have a Compare to Constant block with the constant defined outside the block?

Consider Simulink's Compare to constant block. The constant to which you are comparing the input signal, has to be set in the Function block parameters window (double click on the block). Is there an other block that compares two input signals,…
Karlo
  • 1,630
  • 4
  • 33
  • 57
3
votes
2 answers

How can I change the source workspace in Matlab for 'linearize'?

is there a way to define the source workspace in Matlab for 'linearize' when used within a function? Here a short minimal working example: clear all sys = 'watertank'; open(sys) sys_io(1) = linio('watertank/PID Controller',1,'input'); sys_io(2) …
Ankaios Argo
  • 131
  • 3
3
votes
3 answers

Simulink-Simulation with parfor (Parallel Computing)

I asked today a question about Parallel Computing with Matlab-Simulink. Since my earlier question is a bit messy and there are a lot of things in the code which doesnt really belong to the problem. My problem is I want to simulate something in a…
Elias
  • 51
  • 6
3
votes
1 answer

How to associate .slx file with Simulink

I would like to be able to double-click a .slx file and have it open up in Simulink. If MATLAB is already open, I would prefer that it not open a second instance of MATLAB. Challenges include: unable to find .exe to associate .slx file…
gatorback
  • 1,351
  • 4
  • 19
  • 44