Réponse apportée
Unpack structure, only some fields
make use of fieldnames()? Avoid using the unpack() name. There is a built-in function with the same name. par.a=3.5; par.b=[4...

environ 3 ans il y a | 0

Réponse apportée
Element wise (.*) in Simulink for two matrices with different dimensions
a=[1 2 3; 4 5 6]; b=[1; 0]; a.*b This is a change made in MATLAB in R2016b when implicit expansion is introduced. Prior to R2...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Is it possible to change a parameter in a Simulink model each time it is run via a for loop in a MATLAB script?
Yes. Run Simulations Programmatically sim()

environ 3 ans il y a | 0

Réponse apportée
How do I fetch the linked Data Dictionaries to a Simulnik model with Commands?
There is an API. Start from here https://www.mathworks.com/help/simulink/ug/store-data-in-dictionary-programmatically.html

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Delay certain subsystem in simulink
Make the subsystem a triggered subsystem. The Clock block gives you the simulation time. Compare its output to a Constant block,...

environ 3 ans il y a | 0

Réponse apportée
Checkpoint to save the state of Simulink simulation at a specific sample time
Start from here https://www.mathworks.com/help/simulink/ug/model-operating-point-for-faster-simulation.html

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to activate the Edit-time checks under the Model advisor
on the Modeling tab, beside the "Model Advisor", click the little "down" triangle to see the "drop down list", then check or un-...

environ 3 ans il y a | 0

Réponse apportée
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...

environ 3 ans il y a | 2

Réponse apportée
How to line plot the data in the Matlab?
plot(x,y,'.') is probably good enough.

environ 3 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
how do I write 2^-x in MatLab?
x=1; 2^(-x)

environ 3 ans il y a | 0

Réponse apportée
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')...

environ 3 ans il y a | 0

Réponse apportée
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 ...

environ 3 ans il y a | 0

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Summation in MATLAB in 4 dimenstion
S = sum(X,DIM) sums along the dimension DIM

environ 3 ans il y a | 0

Réponse apportée
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 ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

Réponse apportée
How to use the solutions from the previous study as initial conditions in a new simulation in Simulink?
Save and Restore Simulation Operating Point

environ 3 ans il y a | 1

Réponse apportée
Matlab Simulink command Generator Code Question
Use the "Signal Builder" block. Signal, New, Custom... Specify time-value pairs.

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

Réponse apportée
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.

environ 3 ans il y a | 0

Réponse apportée
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...

environ 3 ans il y a | 1

Réponse apportée
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...

environ 3 ans il y a | 1

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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.

environ 3 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 3 ans il y a | 0

| A accepté

Charger plus