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:

2638 questions
7
votes
6 answers

What's the difference between stateflow and simulink?

As far as I know, stateflow and simulink are often used at the same time, and are both environments developed by MathWorks, who make Matlab. May I know what's the difference between them?
user1487718
6
votes
3 answers

Disable/Comment a block in Simulink

Is it possible to comment out the block in Simulink like it is possible in any programming languages ? I mean, using logic, I can disable the block. but its not the best solution all the time. I would rather disable / comment out the part of the…
Kiran
  • 6,858
  • 30
  • 95
  • 156
6
votes
2 answers

Will this technique reduce the MATLAB realtime workshop coder compilation time?

My workplace use MATLAB and sub-products Simulink, Realtime workshop (RTW), RTW Embedded Coder. We have a large simulink model that is compiled to C then to an object file for loading onto the embedded target. The whole compilation process takes ~3h…
Craig
  • 890
  • 13
  • 27
6
votes
2 answers

Integer to Binary Conversion in Simulink

I know its a very basic question. But still, I am struggling to convert Binary to Integer and vice-versa in Simulink. I could use a function block and use inbuilt Matlab functions to do it. But I, intend to use the Simulink blocks to convert Binary…
Kiran
  • 6,858
  • 30
  • 95
  • 156
6
votes
2 answers

From SIMULINK to workspace FFT?

If I want to plot the PSD of a simple sinusoidal wave in Matlab, I would do something like the following: Fs = 1000; t = 0:1/Fs:1-(1/Fs); x = cos(2*pi*100*t) ; N = length(x); xdft = fft(x); xdft = xdft(1:N/2+1); psdx = (1/(Fs*N)) *…
AhmedWas
  • 924
  • 3
  • 14
  • 35
6
votes
4 answers

Efficient colon operator for multiple start and end points

Suppose I have the following two variables: start_idx = [1 4 7]; end_idx = [2 6 15]; I want to efficiently (no for loop if possible) generate a single row which consists of the colon operator being applied between corresponding elements of…
space_voyager
  • 1,754
  • 2
  • 14
  • 30
6
votes
2 answers

transfer doubles between java and simulink using udp

I need to transfer decimal values between Java program and a Simulink model, to do so i use UDP sockets, they are no problem in the java side. In Simulink i am able to send the values using 'Stream Output' block, but the problem presents while…
mkm
  • 122
  • 1
  • 7
6
votes
1 answer

Implementing custom MATLAB functions in Simulink

I would like to use a custom MATLAB function in Simulink. So far I have done it by placing an embedded MATLAB function block. However, if the custom function contains another custom function the compile process fails. Here is the example of function…
Niko Gamulin
  • 63,517
  • 91
  • 213
  • 274
6
votes
2 answers

Make signal names coming from library links unique?

OK, I've been struggling with this for a while. What is the best way to accomplish the following: where Reaction Wheel 1-4 are links to the same block in a library. When the Speed Counter, Speed Direction and Current signals are added to the final…
Rody Oldenhuis
  • 36,880
  • 7
  • 47
  • 94
6
votes
1 answer

Convert function to Simulink block

How do I convert from a function, that I have written as an m-file, into a block in a Simulink model?
stanigator
  • 10,102
  • 32
  • 88
  • 126
6
votes
1 answer

Increasing simulation time in a Monte Carlo simulation in Matlab/Simulink

I'm running Monte Carlo simulation for a Simulink model with a Matlab script that looks more or less like this : model = 'modelName'; load_system(model) for ii = 1 : numberOfMC % Some set_param... % Some values are set sim(model); …
moumoute6919
  • 2,186
  • 1
  • 11
  • 16
6
votes
1 answer

In Simulink, are Goto and From blocks generally considered bad style?

I was working on a Simulink model recently and was using Goto and From blocks to keep a very busy system from becoming a twisted mess of wires. I was informed that I was not to use Goto and From blocks as they are considered bad style (at least,…
celestialorb
  • 1,798
  • 5
  • 25
  • 48
6
votes
2 answers

Simulink: PID Controller - difference between back-calculation and clamping for anti-windup?

I need to implement an anti-windup (output limitation) for my PID controller. Simulink is offering two options: back calculation and clamping (documentation) which seem to deliver equal results. I know what back calculation is doing mathematically.…
thewaywewalk
  • 24,484
  • 9
  • 62
  • 109
6
votes
1 answer

Create Simulink block for Arduino library like liquidcrystal

I want to use Simulink to create programs for Arduino Uno hardware. But I would like to use existing libraries, like liquidcrystal, to handle output to an LCD display. How can I create an s-function that incorporates the liquidcrystal class file? I…
ashah
  • 193
  • 1
  • 3
  • 14
5
votes
1 answer

TortoiseGit, configure automatic merge tool on per-file-basis

I am using Msysgit with TortoiseGit to manage repositories containing different file types that need special diff and merge tools, including Matlab Simulink files. I have configured these tools in TortoiseGit -> Settings -> External Programs -> Diff…