Answered
Error with writing a function
You must have included this in your script. This is not all of your code. The direct solution for this is to add an "end" line ...

1 month ago | 0

Answered
How to use SIL simulation with a simulink model containing continous blocks.
You could run the whole model in SIL or PIL. Or you could select a subsystem, right click, replace it with a SIL or PIL componen...

1 month ago | 1

| accepted

Answered
How do I change drop - down value of a block in Simulink model for my simulation input object?
For changes like this, if you do it manually, meaning changing from 'Element-wise(K.*u)' to 'Matrix(K*u)', the Simulink model is...

1 month ago | 0

| accepted

Answered
Is it possible to creat a text list of signal names in a bus?
See if this helps you. Your model must have passed model update (Ctrl+D) without error. Select a BusSelector block where the in...

1 month ago | 0

| accepted

Answered
Need to check input between range and convert it if not
The best way is to make sure theta is within [-pi, pi]. All trigonometry functions in MATLAB/Simulink has a defined output range...

1 month ago | 0

Answered
How to call one of the outputs of the function?
phi_ave_x = crk4_aee321_Lorentz(xi,yi,zi,dt) [phi_ave_x, phi_ave_y] = crk4_aee321_Lorentz(xi,yi,zi,dt) [phi_ave_x, phi_ave_y, ...

1 month ago | 0

Answered
How can I get rid of error--'Model' Parameter must be a character vector
If your model name is 'codetrial', then it should be sim('codetrial').

1 month ago | 0

Answered
Simulink unspecified data dimension
Open the MATLAB Function block Editor, click "Edit Data", specify the dimension (size) information of the output data "dist".

1 month ago | 0

Answered
Enable block vs atomic block
The atomic subsystem is executed at 4s, 8s, 12s, etc. if enabled. It is not "after it is enabled (regard this as time 0), then ...

1 month ago | 0

Answered
Detect change between two stateflow
Are you looking for https://www.mathworks.com/help/simulink/model-comparison.html

2 months ago | 0

Answered
Retrieve Simulink model input dimensions using matlab
I think Simulink has a series of ways to determine the signal dimensions. Propagation takes higher priority than back propagatio...

2 months ago | 0

Answered
Why aren't global variables being recognized in Simulink model explorer?
Double click "MATLAB Function1" to open the Editor, click "Edit Data" button, add data "B" as a "Data Store Memory".

2 months ago | 0

| accepted

Answered
Locate MATLAB Class Definition File
'datetime' is a MATLAB class. a=datetime which datetime

2 months ago | 0

| accepted

Answered
Variable not recognized from workspace parameter
In the MATLAB Function block editor, click "Edit Data", specify "Bm" as a "parameter"

2 months ago | 1

| accepted

Answered
Plot Array in Simulink scope
Use a "From Workspace" block to read the data from the workspace to Simulink, then connect the output to a Scope. To show in a...

2 months ago | 0

Answered
How can I nest a function in a function?
MyAD=AD(3) function AD = AD(n) A = hilbert(n); Ainv = A\eye(n); Eye = eye(n); AD = Eye-Ainv*A; end function A = hilbe...

2 months ago | 0

| accepted

Answered
How to use parameters from data dictionary in sinmulink's callback function?
Use API to open the data dictionary and get the value, or the easiest thing to do is Simulink.data.evalinGlobal('modelName','x'...

2 months ago | 0

Answered
How to combine two binary columns
a=[0 1 0 0 1;1 0 1 1 0] s=sprintf('%d%d\n',a(:)) Or b=dec2bin(a) c=reshape(b,2,[]) d=c'

2 months ago | 1

| accepted

Answered
get elements at x from array A without loop
A=10:10:90; B=[1,1,3,6,7,5,4]; C=A(B)

2 months ago | 0

| accepted

Answered
figure saving in created folder. Error using savepath: invalid or missing path
This is really dumb. In your code, the mkdir() line, there is an extra whitespace in front of 'flow_speed'. So you created a f...

2 months ago | 0

| accepted

Answered
How to change simulink variable from matlab script?
You can use set_param(). block='PT1/Transfer Fcn'; a=get_param(block,'Denominator') b=eval(a) b(2)=1.5 c=mat2str(b) set_pa...

2 months ago | 1

Answered
How schould the matlab function be to hold an signal between two values?
The Relay block does exactly that.

2 months ago | 2

Answered
How to get all block parameters from a simulink block?
Use the function that is provided by TargetLink. I used it before but can't remember the name, something like tl_clear_system()?...

2 months ago | 0

Answered
ismember for cell arrays of different sizes
bin_list = {[1], [1,7], [1,7], [1,7,9], [2,8], [3], [1,7]}'; Const=1; f=@(x) ismember(Const,x); cellfun(f,bin_list)

2 months ago | 0

Answered
PID block has underspecified signal dimensions, ALL groundblocks affected
I saw this quite often. I think the cause is that the Ground block doesn't have its Dimension (or size) info defined, not even a...

2 months ago | 0

Answered
figure saving in created folder. Error using savepath: invalid or missing path
add "rehash" after the folder is created. doc rehash

2 months ago | 0

Answered
How to list all blocks that "InitialOutput" parameter is accessible in their "block parameter" interface?
If you look at the help document of the Outport block, it says the "Initial Output" property is valid when the Outport block is ...

2 months ago | 1

| accepted

Answered
How do I execute S-function Block from .m script.
Select the block, right click, select "Properties ...". Click the "Callbacks" tab, select OpenFcn, there should be some type o...

2 months ago | 0

Answered
[Simulink] I want to just switch two values with positive trigger
Use the trig signal to trig a "triggered subsystem", the trigger type is "rising". Inside the subsystem is a "Not" logical block...

2 months ago | 0

Answered
Simulink Transmission Shift Map
It is possible and you are almost there. You have the logic to check whether the speed is increasing (for up shipt) or else (f...

2 months ago | 0

Load more