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
4
votes
2 answers

Loading the data for a Simulink Lookup Table from a file

I've built a Matlab/Simulink model that I'm using to simulate the performance of an underwater robotic vehicle that uses acoustics for various key navigation and localisation functions. Since the characteristics of the ocean change with seasonality…
Assad Ebrahim
  • 6,234
  • 8
  • 42
  • 68
4
votes
1 answer

Simulink: Control Variant Subsystems Using Mask

I would like to find a simple process for switching the model innards under a mask using the mask parameters. This question has expanded enough such that it has been reimplemented here. Variant subsystems are an excellent method and can be…
kando
  • 441
  • 4
  • 16
4
votes
2 answers

Simulink, How does this m-code block work while having input mismatch?

In MATLAB Simulink, I added an MPC (Model predictive control block). I looked inside this block: Inside it there is a wrapper subsystem called MPC. I opened this one via double click: The main block inside this subsystem is optimizer. This block…
ar2015
  • 5,558
  • 8
  • 53
  • 110
4
votes
2 answers

How to create a counter in simulink

I would like to count how many times my signal goes to zero. For example having an impulse signal as input I want a variable which counts how many times the impulse goes to zero. I´m becoming crazy thinking of something....can anybody help…
4
votes
3 answers

Is it possible to stop a Simulink simulation when a certain condition is met?

Assume that you have a Simulink simulation where a certain signal is first positive and after some time t in a given interval, it becomes negative. Your goal is to find the zero-crossing. A first approach would be to plot the signal over the given…
Karlo
  • 1,630
  • 4
  • 33
  • 57
4
votes
1 answer

Why use SIL(Software in the Loop) before HIL(Hardware in the Loop) if MIL(Model in the loop) simulation is already performed?

I have implemented a new controller logic in simulink and tested it using MIL(Model in the Loop) simulation. Is it mandatory to perform SIL before going to HIL? What kind of errors can be found in SIL which can't be detected in MIL? Please help…
Leo
  • 43
  • 1
  • 1
  • 7
4
votes
2 answers

What are the relationships between workspace, .m scripts and Simulink models and how can I use them efficiently?

I'm using a lot of MATLAB for a Control class and something is really bumming me out. They want us to use a lot of Simulink even though I find the visual representation not that helpful and the interface between Simulink and MATLAB scripts hard to…
4
votes
1 answer

Represent C struct of pointers using Simulink Bus

How can I associate a C struct of pointers with Simulink.Bus ? Say I've C struct: typedef struct { int32_T *a; uint8_T *b; } Bus_X ; then for Simulink.Bus.objectToCell { ... 'Bus_X', ... 'Bus.h', ... …
P0W
  • 46,614
  • 9
  • 72
  • 119
4
votes
1 answer

Simulink simulation behaving massively different than the same simulation using rk4

I have difficulties simulating an object discribed by the following state space equations in simulink: The right hand side of the state space equation is described by the funcion below. function dxdt = RHS( t, x, F) % parameters b = 1.22; %…
Lukasz
  • 2,257
  • 3
  • 26
  • 44
4
votes
0 answers

Matlab C++ S-Function with multiple source files

I have a simulink model with a c++ s-function. This s-function needs access to a lot of (>50) classes. Each class is consists of a header (.h) and a source (.cpp) file. I have also divided my code into multiple…
Gustav-Gans
  • 365
  • 1
  • 3
  • 13
4
votes
1 answer

Transfer function in MATLAB/Simulink

I am trying to model a transfer function block for say 1/(s+1). What is the easiest way to implement a block for a transfer function in Simulink?
stanigator
  • 10,768
  • 34
  • 94
  • 129
4
votes
2 answers

How to use rate limiter with square signal and variable step size in Simulink?

How to use rate limiter with square signal and variable step size in Simulink? Here's a screenshot of the model I'd like to set up: model: I feed a customized rectangular signal to a rate limiter to avoid vertical slopes. Unfortunately that doesn't…
JohnND
  • 103
  • 1
  • 12
4
votes
2 answers

Code generation - Alternative to Simulink API

This is about a typical problem in larger embedded system projects: Data from a text-file/database must be hard coded to C-code. The data will change the control flow, table dimension etc. What is the solution of choice? Background: In our (large)…
goofy
  • 549
  • 2
  • 7
4
votes
0 answers

How to properly propagate multiplex signal names to scope legend via bus system? (Simulink)

I substituted my originial question, the problem is still the same, but the conditions are now different. To review the original question, have a look at the revisions. I'm looking for a way to interactively select the signals I want to get…
Robert Seifert
  • 25,078
  • 11
  • 68
  • 113
4
votes
3 answers

Determining direct-feedthrough paths without compilation/execution

I am currently working on a tool written in M-Script that executes a set of checks on a given simulink model. This tool does not compile/execute the model, I'm using find_system and get_param to retrieve all the information I need in order to run…
user656588