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

How to get name of MATLAB function ports?

How can I can get the name of MATLAB function block ports ? I have tried this : Port = get_param(SourceBlock, 'PortHandles'); %SourceBlock is the Matlab Function block Port_Name = get_param(Port.Inport, 'Name'); But it returns me an empty char.
Lucas
  • 247
  • 3
  • 13
0
votes
1 answer

Using Slice Block in Simulink

I am having some trouble using the Slice block(Xilinx Bit Slice Extractor). I need to extract 2 bits before the Binary Point of Input. So if the input is represented in 2's complement, and if the input is say for instance 2.25 It would represented…
Kiran
  • 8,034
  • 36
  • 110
  • 176
0
votes
1 answer

Write in a DocBlock programmaticaly Matlab Simulink

I have a Simulink model with a DocBlock inside and i would like to create a script to write inside this DocBlock. I already have this code : A = find_system('MyModel', 'BlockType', 'SubSystem', 'Mask', 'on', 'MaskType', 'DocBlock'); B =…
Lucas
  • 247
  • 3
  • 13
0
votes
1 answer

Simulink: FOR iterator and selector block

I am trying to have simple functionality using a 2D vector [M x N]. My intention is to iterate the rows and read the columns. So, I use a FOR iterator subsystem, set the FOR iterator from 0 -> M-1 and then perform some operations on the read…
blackbug
  • 1,098
  • 3
  • 13
  • 40
0
votes
1 answer

Plotting double data in Simulink Scope

i want to plot some data by using Simulink Scope, here is my simplified Simulink model: enter image description here and there are my code in the MATLAB Function Block: 1. function pCO2_a = Oxy(Qg) 2. 3. coder.extrinsic('testWQ'); 4. 5. pCO2_a =…
0
votes
0 answers

Open a Simulink model into the memory from another folder

I have several Simulink models in different folders and I need to load all of them in the Matlab, one after the other. To this goal, I have used the following code. addpath(genpath(strcat('\ConfigsSimulinkModels'))); init; %Initialize…
zari
  • 1,709
  • 1
  • 12
  • 18
0
votes
0 answers

How to retrieve Source block Name of a Function block Matlab Simulink

I have a simple model with a constant block connected to a function block connected to an output. Constant block can take True or False. And so i would like in the function block to color the Constant block according to the value (Green when True…
Lucas
  • 247
  • 3
  • 13
0
votes
0 answers

Hide blocks of a model for estheticism in Matlab Simulink

I have a model which looks like this : And i would like to know if there is a show/hide tool to select all non colored blocks and hide them like this : And then be able to show them again. Thanks !
Lucas
  • 247
  • 3
  • 13
0
votes
0 answers

Follow/Highlight signal path after Simulation (Matlab Simulink)

I have a model which looks like this : In Equipement2 block for example : In ETAFON1 block for example : In this example i have only put 2 variable "true" (to make equipement2 red) and i would like to know if it's possible to follow/highlight…
Lucas
  • 247
  • 3
  • 13
0
votes
1 answer

How to import a header file to load constant values in Simulink? (for generable code)

I'm developing a Simulink model with many constants. I'm trying to: Avoid hardcoding every constant in the model and have something unreadable. Be able to know what that 9.73288483... constant in the middle of my model stands for. I wanted to add…
Hood
  • 63
  • 1
  • 7
0
votes
0 answers

Sending continuous data to remote machine using Simulink TCP/IP send block

I am trying to send a continuous-time data from Simulink simulation to a Raspberry Pi within the same network. All I am getting at the receiving end is the random unreadable characters. Is it because of the data type mismatch?? Or do I need to add…
Rabindra
  • 19
  • 5
0
votes
0 answers

Simulink TCP/IP communication with Raspberry PI

I am trying to send data from my Simulink simulation to the Raspberry Pi on the same network and write the data on CSV format. I am using the following python code to read data and write it to CSV file. import csv import socket TCP_IP =…
Rabindra
  • 19
  • 5
0
votes
0 answers

Simulink counting switching frequency?

I need to create some kind of counter, that counts how many times all of the transistors(signal_1, signal_2, signal_3, signal_4) I have used turn ON (and OFF) per second. I need to show the difference in switching frequency between 2-level and…
Jakey
  • 101
  • 4
0
votes
0 answers

Why do I get the error “Dimensions of arrays being concatenated are not consistent while creating COMTRADE file for simulink model?

I am using the above code to generate COMTRADE files for different scenarios in the simulink. but whenever I add a display into the simulation model i get an error saying the following Caused by: Dimensions of arrays being concatenated are not…
Pro
  • 1
0
votes
1 answer

Generate specific number of entities to a concrete time point in simulink

The problem is following: We want to simulate for 24 seconds. At every second except the 9th, 14th and 17th, the Entity-Generator must generate random number of entities e.g. between 1 and 3. For the concrete seconds (9th, 14th and 17th), the number…
H.Karatsanov
  • 199
  • 4
  • 16
1 2 3
99
100