Answered

Discrete Average on Simulink

See attachment. Use "window length" of "6" instead of "600" to illustrate. The build-in "Moving Average" block (it requires "DS...

Discrete Average on Simulink

See attachment. Use "window length" of "6" instead of "600" to illustrate. The build-in "Moving Average" block (it requires "DS...

28 dagen ago | 2

Answered

How to line plot the data in the Matlab?

plot(x,y,'.') is probably good enough.

How to line plot the data in the Matlab?

plot(x,y,'.') is probably good enough.

28 dagen ago | 1

| accepted

Answered

How do I save a SINGLE value from the workspace?

You will have to assign that value to a temparary variable and then save it. a=rand(10,2); %save test.mat a(8,:) % this will c...

How do I save a SINGLE value from the workspace?

You will have to assign that value to a temparary variable and then save it. a=rand(10,2); %save test.mat a(8,:) % this will c...

30 dagen ago | 0

Answered

Bias block not working properly with fixed point data type

fixdt(0, 12, 0) means "unsigned". The Bias block does the "Y=U+Bias" operation. The value of -1 can't be represented. If you try...

Bias block not working properly with fixed point data type

fixdt(0, 12, 0) means "unsigned". The Bias block does the "Y=U+Bias" operation. The value of -1 can't be represented. If you try...

ongeveer een maand ago | 0

| accepted

Answered

Get DataType from a Simulink Consant Block (datatype is propagated from the output)

Make sure your model can pass model update (no errors). See example below: f14;%open the example model f14([],[],[],'compile')...

Get DataType from a Simulink Consant Block (datatype is propagated from the output)

Make sure your model can pass model update (no errors). See example below: f14;%open the example model f14([],[],[],'compile')...

ongeveer een maand ago | 0

Answered

How to clear the search terms in the search box of the library browser in Simulink?

All previously typed search terms are saved. You can double click or press-and-hold to select all, then type it over. You don't ...

How to clear the search terms in the search box of the library browser in Simulink?

All previously typed search terms are saved. You can double click or press-and-hold to select all, then type it over. You don't ...

ongeveer een maand ago | 0

Answered

How to use interpolate struct data in simulink?

In general, in Simulink, the "2-D Lookup Table" block can be used to do what interp2() does in MATLAB. You need to figure out t...

How to use interpolate struct data in simulink?

In general, in Simulink, the "2-D Lookup Table" block can be used to do what interp2() does in MATLAB. You need to figure out t...

ongeveer een maand ago | 0

| accepted

Answered

Summation in MATLAB in 4 dimenstion

S = sum(X,DIM) sums along the dimension DIM

Summation in MATLAB in 4 dimenstion

S = sum(X,DIM) sums along the dimension DIM

ongeveer een maand ago | 0

Answered

Scalar variable as output of Matlab function in Simulink

In your code, you use the find() function. It could return zero, one or more results. That is why the inital error message says ...

Scalar variable as output of Matlab function in Simulink

In your code, you use the find() function. It could return zero, one or more results. That is why the inital error message says ...

ongeveer een maand ago | 0

| accepted

Answered

The Simulink model is fixed-point based on floating-point numbers

No way to tell what exactly caused the problem from the snapshot of the model. In the MATLAB Function block editor, you can clic...

The Simulink model is fixed-point based on floating-point numbers

No way to tell what exactly caused the problem from the snapshot of the model. In the MATLAB Function block editor, you can clic...

ongeveer een maand ago | 0

Answered

How to use the solutions from the previous study as initial conditions in a new simulation in Simulink?

Save and Restore Simulation Operating Point

How to use the solutions from the previous study as initial conditions in a new simulation in Simulink?

Save and Restore Simulation Operating Point

ongeveer een maand ago | 1

Answered

Matlab Simulink command Generator Code Question

Use the "Signal Builder" block. Signal, New, Custom... Specify time-value pairs.

Matlab Simulink command Generator Code Question

Use the "Signal Builder" block. Signal, New, Custom... Specify time-value pairs.

ongeveer een maand ago | 0

| accepted

Answered

variation of the parameters of a diode during simulation

The value of a "parameter" of a block is designed to be constant during a simulation. There are ways to pause a simulation, chan...

variation of the parameters of a diode during simulation

The value of a "parameter" of a block is designed to be constant during a simulation. There are ways to pause a simulation, chan...

ongeveer een maand ago | 0

Answered

How to copy a subsystem block from 2019b to 2021b in simulink?

In R2019b, save your model or blocks to a file (.slx or .mdl). Then in R2021b, Open it and then save it.

How to copy a subsystem block from 2019b to 2021b in simulink?

In R2019b, save your model or blocks to a file (.slx or .mdl). Then in R2021b, Open it and then save it.

ongeveer een maand ago | 0

Answered

Error: The external inputs specified for the block diagram indicate that the port dimensions should be [MxN]. Instead, the port dimensions are being set to [?].

If your variable size is 1x11 and you import it to Simulink as it is, then the data is interprated as First column is time vac...

Error: The external inputs specified for the block diagram indicate that the port dimensions should be [MxN]. Instead, the port dimensions are being set to [?].

If your variable size is 1x11 and you import it to Simulink as it is, then the data is interprated as First column is time vac...

ongeveer een maand ago | 1

Answered

Error: When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar

In R2022b, open this doc and see the example model. To import 2D data, there is a specific format which should be the same rega...

Error: When loading a matrix input, the blocks loading the corresponding data columns of the matrix must specify dimension using a scalar

In R2022b, open this doc and see the example model. To import 2D data, there is a specific format which should be the same rega...

ongeveer een maand ago | 1

Answered

extract points from a table and plot them on Simulink

Let s=1/48000 and A be your matrix data above. Here are the two methods I mentioned in the answer to your previous question. Sp...

extract points from a table and plot them on Simulink

Let s=1/48000 and A be your matrix data above. Here are the two methods I mentioned in the answer to your previous question. Sp...

ongeveer een maand ago | 0

| accepted

Answered

Speed of Sfunction builder in Simulink

The execution time of the S-function depends on the processing task and the CPU. Generally, more complex task, more time. More p...

Speed of Sfunction builder in Simulink

The execution time of the S-function depends on the processing task and the CPU. Generally, more complex task, more time. More p...

ongeveer een maand ago | 0

| accepted

Answered

Separate a signal in two signals with Simulink

Pre-process the data in MATLAB and then import the two splitted data sets into Simulink. Or Use the "Selector" block. In the di...

Separate a signal in two signals with Simulink

Pre-process the data in MATLAB and then import the two splitted data sets into Simulink. Or Use the "Selector" block. In the di...

ongeveer een maand ago | 0

| accepted

Answered

Creating custom model advisor checks for Stateflow

Yes. Use find(xxx, '-isa', 'Stateflow.Data') to find and then get(). web(fullfile(docroot, 'stateflow/api/properties-and-method...

Creating custom model advisor checks for Stateflow

Yes. Use find(xxx, '-isa', 'Stateflow.Data') to find and then get(). web(fullfile(docroot, 'stateflow/api/properties-and-method...

ongeveer een maand ago | 0

| accepted

Answered

Error "An input signal to a Merge block must be connected and must originate from a conditionally executed subsystem that is not an Iterator subsystem"

For this particular case, use a Switch block to replace the Merge block. "u1" can be used to control the switch.

Error "An input signal to a Merge block must be connected and must originate from a conditionally executed subsystem that is not an Iterator subsystem"

For this particular case, use a Switch block to replace the Merge block. "u1" can be used to control the switch.

ongeveer een maand ago | 0

| accepted

Answered

Dimension 1 is fixed on the left-hand side but varies on the right ([512 x 512] ~= [:? x :?]).

m and n are specified as "Input" to the MATLAB Function block, so their value could vary during simulation although you probably...

Dimension 1 is fixed on the left-hand side but varies on the right ([512 x 512] ~= [:? x :?]).

m and n are specified as "Input" to the MATLAB Function block, so their value could vary during simulation although you probably...

ongeveer 2 maanden ago | 0

| accepted

Answered

Can folks replicate the discrepancy in the number of model advisor checks between command line and dialog box queries for R2021b and R2022a?

I can see the differences in R2022b. You want to know why they are different, or what exactly are the difference? From the Mode...

Can folks replicate the discrepancy in the number of model advisor checks between command line and dialog box queries for R2021b and R2022a?

I can see the differences in R2022b. You want to know why they are different, or what exactly are the difference? From the Mode...

ongeveer 2 maanden ago | 0

Answered

Mask parameters now have compulsory box for alias in property editor. What is it for?

The R2022b online documentation does not seem to match the documentation from the installation. It seems to be a mistake in the ...

Mask parameters now have compulsory box for alias in property editor. What is it for?

The R2022b online documentation does not seem to match the documentation from the installation. It seems to be a mistake in the ...

ongeveer 2 maanden ago | 0

Answered

perform interpolation each row of a matrix

You can use interp1() directly for this without for-loop. x=1:10; A=(1:10)'+(1:10); xi=5; y=interp1(x,A',xi)

perform interpolation each row of a matrix

You can use interp1() directly for this without for-loop. x=1:10; A=(1:10)'+(1:10); xi=5; y=interp1(x,A',xi)

ongeveer 2 maanden ago | 0

Answered

About the use of Data Store Memory

From https://www.mathworks.com/help/releases/R2022b/simulink/slref/datastorememory.html "You can use Simulink.Signal objects in...

About the use of Data Store Memory

From https://www.mathworks.com/help/releases/R2022b/simulink/slref/datastorememory.html "You can use Simulink.Signal objects in...

ongeveer 2 maanden ago | 0

Answered

Question about toolbox dependencies

I think you've found a bug. Report it to the Mathworks or see if they already reported this. I tried your example in R2020b and...

Question about toolbox dependencies

I think you've found a bug. Report it to the Mathworks or see if they already reported this. I tried your example in R2020b and...

ongeveer 2 maanden ago | 0

Answered

Simulink model diverges depending on Stop time (tend)

This is odd and rare but could be explained. First of all, your model or dynamics is probably on the boardline of being unstab...

Simulink model diverges depending on Stop time (tend)

This is odd and rare but could be explained. First of all, your model or dynamics is probably on the boardline of being unstab...

ongeveer 2 maanden ago | 0

| accepted

Answered

Where is the User's Manual?

I would click the "Help" button on the dialog. It should bring up the doc or manual since it is mentioned in the description of ...

Where is the User's Manual?

I would click the "Help" button on the dialog. It should bring up the doc or manual since it is mentioned in the description of ...

ongeveer 2 maanden ago | 0