Questions tagged [simulink]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Cant read values from Workspace in Simulink

I have a variable in the Workspace uavMission.origin which can't be read in the simulink model I use the from Workspace Block I get the error that the origin does not exist But uavMission has orgin ...
RoostOne's user avatar
-2 votes
0 answers
11 views

I want to freeze the output at the first signal that satisfies a specific condition

"I have a set of variable signals and I want to freeze the output at the first signal that satisfies a specific condition. Even if this condition continues to be true, I want to keep this value ...
Nada ALainiah's user avatar
0 votes
0 answers
5 views

"Leadscrew" block in Simscape: is it possibile to convert this block to rotating nut and translating screw? How the physics is modeled by the block?

I have to model a physical system that uses a ballscrew to convert the motion of the rotating nut in the traslation motion of the screw. I'm using the block Leadscrew, but the results are not good and ...
Edoardo Levantino's user avatar
0 votes
0 answers
4 views

Implementation of sigmoid function as input in simulink

I am supposed to use a sigmoid function as an input for a cruise controller system with an integrator controller. I tried to find the Laplace transform for the function but i could not find any. ...
Bahador Ahmadisourenabadi's user avatar
-1 votes
0 answers
19 views

Why is this PPO agent not able to learn its task?

I am currently trying to learn the leg coordination of a hexapod robot, meaning it should learn when to lift its legs so that an efficient gait(tripod, wave, etc...)emerges. I am relatively new to RL ...
Bossel's user avatar
  • 1
0 votes
0 answers
18 views

Error in Executing the Simulink model 'Error in port widths or dimensions.'

I have the Simulink model. I want to execute the model. But while executing it, the model shows the error mentioned below: Error:Error in port widths or dimensions. 'Output Port 1' of '...
Urvesh's user avatar
  • 331
0 votes
0 answers
14 views

ramprate % /min rate limiter in simulink

how to implement running % /min in simulink ? I need to limit the Pwr (kw) output to 5%/min using a rate transition block. Im using the dynamic rate limiter block as follows but the calculation of %/...
user183060's user avatar
0 votes
0 answers
12 views

problem of Error evaluating 'InitFcn' callback of MPC block (mask)?

how i diagnose this problem that i keep getting in simulate this model in simlink the error HERE_FILES (i will attack the model ) : Error evaluating 'InitFcn' callback of MPC block (mask) 'FB_MPC/...
TRicheT's user avatar
0 votes
0 answers
9 views

Using SimUserIncludeDirs when running Simulink model from the command line

I have a Simulink model that includes a lot of additional source code. The include folders are specified in the "Include Directories*" of the model Configuration Parameters. However, I need ...
ilya1725's user avatar
  • 4,536
-1 votes
0 answers
18 views

The first input to set_param must be of type 'double' or 'char'

I hava problem in matlab appdesigner I make an Edit Field as Text and my code is set_param(app.modelEditField,'SimulationCommand','update') I think first input of set_param is 'char' ('update') so ...
Dayoung's user avatar
0 votes
0 answers
22 views

Converting derivative block of Simulink into a python code

I have a Simulink model and I want to translate the whole model to a python code. Now I am struggling with the translation of a block named "derivative". The documentation regarding this ...
Soheil yns's user avatar
0 votes
0 answers
8 views

Simulink Index error Modular multilevel converter sorting and Switching function

Good day all, I am new here and I am trying to implement a heapsort algorithm in Simulink using heapsort algorithm through a MATLAB function. The input to the function is from a mux block which ...
Coder_V's user avatar
0 votes
0 answers
7 views

derivation block changes time step - Simulink

I am trying to derivate a speed profile with a fixed step size of 0.005 sec, but after the derivation the time step size increases to 1 second. I have set, in the Model settings, the timestep size to ...
Darius Florian's user avatar
0 votes
0 answers
15 views

road extraction in Matlab

Simulink Model I want to extract a part of a road from a map and import it in MATLAB as a script function, i tried using Driving scenario design toolbox: Got the road from the OpenStreetMap, extracted ...
Asmaa GZ's user avatar
0 votes
0 answers
22 views

Problem in my script on MATLAB, theme: kinematic bicycle model, road extraction, Simulink

function [xPath, yPath] = extractCoordinates() % createDrivingScenario Returns the drivingScenario defined in the Designer function scenario = road() % createDrivingScenario Returns the ...
Asmaa GZ's user avatar
-1 votes
1 answer
34 views

Step graph using a function block and scope in Simulink

I'm trying to to get a step graph from the following code (extracted from my main project): Code: function y = fcn(~) tic; y = 0 pause(5); y = 1; pause(3); y = 0; pause(5);...
K S Suurya's user avatar
0 votes
0 answers
35 views

Implement a Rate Limiter in Simulnk without using the in-built Rate Limiter block

Implement a Rate Limiter in Simulnk without using the in-built Rate Limiter block. Use the basic blocks(any block other than Rate Limiter) to design a rate Limiter. Rising Slew Rate is 3 and Falling ...
Sanjana Mailagani's user avatar
0 votes
0 answers
43 views

Implement an SPI SD card reader to log data to a STM32H743ZI2 board through CubeMx and Simulink Embedded Coder Support Package for STM32

I am fairly new in the stm32 world and i am using a stm32h743ZI2 board in simulink for coding. Basically the board is connected to multiple sensors through I2C, SPI, CAN etc. And what I want to do is ...
luca Patanella's user avatar
0 votes
0 answers
23 views

What is uavParam and uavParam.ic in "Waypoint Follower for Fixed-Wing UAV" example (UAV toolbox)?

I discovered uavParam variable which has several fields (at least two: uavParam.ic.Pos_0 - for initial position probably and uavParam.ic.gsLL). It is located inside Waypoints constant vector - the ...
syat-cd's user avatar
0 votes
1 answer
21 views

How to convert filter domain S to equation with T sampling?

enter image description here This is band-pass filter If lower frequency cut-off is 78.075 rad/s and higher frequency cut-off is 312.300 How to convert filter domain S to equation with T sampling? If ...
Gg Yu's user avatar
  • 1
0 votes
0 answers
8 views

Create a data buffer with records of simulink.bus in classdef

I'm a PLC programmer struggling with Matlab/Simulink. Currently I try to make a new class. Within this class I want a 'DataBuffer' with a length of 5 records of a datatype 'ST_MyRecord'. But I'm ...
Ludo's user avatar
  • 11
0 votes
0 answers
23 views

Problem with function callback with using stateflow chart in 2019b MATLAB/Simulink version

I have two models in Simulink. Master (A) and slave (B) with is linked by Referenced Model block to model A. In the future i want to refer more models in A. Model B has two function-call subsystems (...
John's user avatar
  • 1
0 votes
0 answers
8 views

cc cv charger issue in maltab simulink li ion cell model?

CC CV charger have an issue with charging series connected cells, when initial soc is t different the at the end of charging 2 cells voltage drop? is this cc cv charger issue of cell model issue? ...
adnan ashraf's user avatar
0 votes
1 answer
29 views

Expression to Simulink Model Conversion

The input will be a string (eg.'X+Y+Z') and the output must be a Simulink Model(slx file). This should be done using m-script. The Simulink Model should be dynamic(the model must be according to the ...
Sanjana Mailagani's user avatar
0 votes
0 answers
16 views

OFDM simulation in Simulink

The Orthogonal Frequency Division Multiplexing (OFDM) parameters are as follows: Subcarriers: The baseband signal is composed of 512 orthogonal subcarriers. Subcarrier Usage: Out of the 512 ...
henry8866's user avatar
0 votes
0 answers
23 views

Matlab Simulink: Summing up values only on specified points in time

From this signal I need to sum up the values, which the signal has, on multiples of 10. Basically the peaks at 10s, 20s, .... and so on. How can I accomplish this in Simulink? Signal with peaks marked ...
Diodendomme's user avatar
0 votes
1 answer
23 views

Error building LEGO Mindstorms EV3 project in MATLAB / Simulink on Linux

I am trying to build a simple project for EV3 hardware using Simulink. When trying to build the model, i get the error Code generation information file does not exist. I have searched everywhere and ...
Magnus E-F's user avatar
0 votes
0 answers
37 views

"Attempt to extract field 'point1' from 'mxArray'." error while trying to use "houghlines" command in MATLAB

I am using a matlab function block in simulink. Im trying to detect lines in a simulation. When I tried to use "houghlines" directly, it said that I need to use dynamic memory allocation. So ...
gill bates's user avatar
0 votes
0 answers
22 views

How to Create a Trajectory for a Tracked Vehicle Model in Simulink?

I am currently working on a tracked vehicle model in Matlab Simulink that needs to follow a trajectory while considering ground parameters. I have referred to a specific paper that outlines the ...
Portofrei's user avatar
0 votes
0 answers
43 views

Reading values from Python Dictionary in Simulink Matlab Function Block

I have problems reading values from a Python dictionary in to Simulink using a Matlab Function Block. The Python Dictionary is stored in the Matlab Base Workspace. It contains Data delivered by a MQTT-...
schollsi's user avatar
0 votes
0 answers
13 views

Currently I am working in a BLDC motor control, Can you tell me how to control the Angle of the motor?

We should not use any type of simscape blocks in the MATLAB The motor should be controlled through PID controller Now I am build the dynamic model of the motor and it is fed with the sine blocks I ...
Ravi Sankar's user avatar
0 votes
1 answer
10 views

Cannot open a simulink project, showing that the project is empty

Other colleague can open the project without problems. But on my pc it shows that the project is empty. I tried to turn of the pc and start again. I was expecting I can open the project. I can open ...
Margarita Wen's user avatar
0 votes
0 answers
15 views

Converting two systems running in one loop to simulink

I have a MATLAB code that is running under a single for loop. In that for loop, there are two systems. Second system uses as input the outputs of first system. Now I am trying to configure it in ...
Osman Unlu's user avatar
0 votes
0 answers
14 views

How do I reference the object in a System block on Simulink?

I'm programmatically creating a Simulink model, and as part of the model I am creating System blocks which use a class I have created. The issue I am having is I don't know how to access these objects ...
Edoardo Modestini's user avatar
0 votes
0 answers
23 views

Adaptive Neural Network in Simulink

I am trying to configure an adaptive neural network in simulink. I based it on the paper in the link. text The one I tried to create failed. I would really appreciate it if you could give me the code ...
woong's user avatar
  • 1
0 votes
0 answers
23 views

Simulink only runs in auto solver selection but not if solver is selected

I have a compllex simulink model which runs only if I choose automatic solver selection. I want to fix the solver across my different experiments so I ned to fix the solver. solver selection The error ...
Varun Kotian's user avatar
0 votes
0 answers
16 views

Discrepancy in PI Controller Outputs for voltage control and current control for droop control strategy in MATLAB

Issue: I am implementing a PI controller for the dq-transformation of a three-phase system in MATLAB. The goal is to control the q-axis voltage (iq_ref) and current (vq_inv) based on desired values. ...
Abdul Moiz Qureshi's user avatar
0 votes
0 answers
6 views

Change the signal state only if the signal has been constant for a certain time frame

My Simulink model has a subsystem that outputs a signal that I want to use to activate another subsystem. I only want to activate the other subsystem if the output signal of the first subsystem has ...
mab0189's user avatar
  • 126
0 votes
0 answers
20 views

Simulink: Component doesn't show in the Diagnostics Viewer Tab (Size computation error)

I'm trying to troubleshoot an error on Simulink but the Diagnostic Viewer window is being extremely vague and it's not showing a specific model for the error. Anyone know what this error might be?: ...
tadm123's user avatar
  • 8,354
0 votes
0 answers
53 views

Matlab: Simulink Coder - Generation of header files for every Bus variables

I have added this code snippet to my Simulink Coder project in order to generate a header file for every Bus: % Get all the variables of the workspace vars = evalin('base', 'who'); % ...
Hamad Elyes's user avatar
0 votes
0 answers
21 views

Display not detected for Simulink Model Comparison

I'm working with Simulink (MATLAB2023a) and was looking for something for versioning that could report model changes in more or less detail. I found this video from Mathworks that links to this ...
LucaT3X's user avatar
  • 11
0 votes
0 answers
11 views

Issue with s-function in simulink test sequence

Upon trying to test a test sequence/ test harness (using a test case manager), I get the following error in the test case manager window: Cannot register run-time parameter for dialog parameter 1 for ...
pseudoswe's user avatar
1 vote
0 answers
16 views

Inserting a comment in the pdf report of the execution of a matlab.unittest.TestCase function

I have not been able to find the solution to this anywhere: I have a Testcase class, containing several functions that relate to all the individual tests I wish to perform on a Simulink model. The ...
Marco Montanaro's user avatar
0 votes
0 answers
16 views

Translating Input Signal to Output Signal in Matlab Simulink

How can I use Matlab Simulink to construct the output signal y(t) based on the input signal x(t)? I am limited to using the following components: proportional system (PS), integral system (IS), ...
Bahamas's user avatar
  • 345
0 votes
0 answers
79 views

STM32 Simulink Embedded Coder

I am new to Simulink Embedded Coder. I have a custom STM32G473 board. I am flashing an LED. I've done this successfully with both C code, and generated from simulink. I am trying to configure the ...
Jsprenger16's user avatar
0 votes
1 answer
41 views

What is the "-C-" block in this example?

I have a the following image of a SIMULINK example (I can't click into the model): But what is the "-C-" block (the PV0 one which is an input to the integrator block)? I think its a ...
Achilles chan's user avatar
0 votes
0 answers
25 views

Why can voltage error be converted to current using a PI controller in dq-frame?

As shown in: Voltage Control Block How could a PI controller convert the voltage error to current (in voltage control block)? or How could a PI controller convert the current error to voltage (in ...
Abdul Moiz Qureshi's user avatar
0 votes
0 answers
31 views

serial data matlab and arduino not send data from mega to uno via simulink

I send data from matlab command via serial to arduino uno in this command : arduino=serialport("COM9",115200); writeline(arduino,"45,90,135,180,225,273,231"); I want to send this ...
elgamal's user avatar
0 votes
0 answers
25 views

Simulink bus, array lenth based on variable

I'm just starting with MatLab and as a PLC programmer I was wondering if it is possible to create a 'bus' based on an ARRAY of STRUCT were the size of the array is determined by a 'constant' variable. ...
Ludo's user avatar
  • 11
0 votes
1 answer
50 views

How to control/trigger a Simulink model (running on external mode) from MATLAB script

As part of a HiL simulation, I have a plant model in Simulink which is running on external mode on a PLC. The MPC controller is running on the PC as a MATLAB script. At each sample time, the control ...
Kamal's user avatar
  • 1

1
2 3 4 5
58