Réponse apportée
Difference between successive rows in a column
a=magic(6); b=diff(a(:,4)) a(2:end,end+1)=b

presque 4 ans il y a | 0

Réponse apportée
How to make this string a = '(0 0 0)' into a double b = [0 0 0]?
a = '(12 2.8 1.22)'; b=sscanf(a,'(%f %f %f)') b=transpose(sscanf(a,'(%f %f %f)'))

presque 4 ans il y a | 0

Réponse apportée
Sharing Custom Simulink Library via Toolbox
https://www.mathworks.com/help/matlab/matlab_prog/create-and-share-custom-matlab-toolboxes.html https://www.mathworks.com/help/...

presque 4 ans il y a | 0

Réponse apportée
Compare all the signals from 2 data inspector or .mat files
This is exactly what Simulink Data Inspector does. Follow the documentation and examples. https://www.mathworks.com/help/simul...

presque 4 ans il y a | 0

Réponse apportée
How to select a subsystem for convertToModelReference with an unknown subsystem name?
Since you have only one Subsystem block in the root level of the model, this will return this Subsystem. find_system(args,'Sear...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Disable TransportDelay warning when time delay is set to 0
I understand the convenience of your using the TransportDelay block. When there is no delay, simply set the delay to be zero. Bu...

presque 4 ans il y a | 0

Réponse apportée
fprintf use with error
use single quote mark, not double quote mark a=1.2; fid=1 fprintf(fid, 'this is my number %f', a)

presque 4 ans il y a | 0

Réponse apportée
Simulink "globals" not working as expected
"global" data store is not meant for saving data between different simulation runs. Refer to this: web(fullfile(docroot, 'sim...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Masked Subsystem: How to pass a double vector to a constant?
I don't know why this old question suddenly appears at the top. I believe the answer to this question is a trick. Use mat2str()...

presque 4 ans il y a | 0

Réponse apportée
The Problem Of Multiple Gotos?
This is a bad practice or even incorrectr practice to put a "Goto" block inside a library component, which you know will be used...

presque 4 ans il y a | 0

Réponse apportée
using a stateflow as a subsystem reference with some parameters to be editted after instantiation
Create your Stateflow chart and create parameter variables, add a mask to the Stateflow chart to bring all those parameter varia...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How do I manage the Model configuration parameters when using variant with several system targets ?
You can have multiple model configuration sets saved with the model and switch them. It can be done manully or through API. htt...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
how to find index from matrix in another matrix?
%C is the logical index matrix. A=zeros(2,3,4); A(:,:,4)=4; A(:,3,4)=5; C=or(A==4,A==5) %To use it to select correspondin...

presque 4 ans il y a | 0

Réponse apportée
How to open a Simulink example using command
Most likely, you don't have the toolbox installed. Or, if installed, the path is not correctly set. Try these two commands in yo...

presque 4 ans il y a | 0

Réponse apportée
How to solve the the parameter 'SampleTime' must be a real double scalar (period) or a real double vector of length 2 (period, offset).
This is the cause and it shocked me. The "Ts" is currently of data type "single". Change it to be "double".

presque 4 ans il y a | 0

Réponse apportée
know the number of open unsaved(dirty) simulink files
bd=find_system('type','block_diagram','dirty','on')

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Definition and Control of Variables via the Simulink Dashboard
Not sure if you are aware of the differences. The blocks in Dashboard are used to control parameter values and display signal va...

presque 4 ans il y a | 0

Réponse apportée
syntax cellstr Error when using double as input argument
There is no point comparing two functions (with the same name) in two software and demanding one behaves the same way as the oth...

presque 4 ans il y a | 1

Réponse apportée
Finding settling time of a response.
stepinfo() lsiminfo()

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Option to confirm tab auto-completion with 'Enter'
MATLAB Preferences, Editor/Debugger, Automatic Completions Command Window, Automatic Completions

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Real time, Matlab, SpeedGoat, Simulink, read write data, Solution?
To store runtime data like "A" in your example, use "Data Store Memory" block in your Simulink model. Use "Data Store Read" and ...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
matlab R2020b randperm fuction is not random
Duh! You store the result in "order" and display it again. Of course they are the same! order = randperm(10) disp(order) orde...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Identifying data in plot from legend.
This might help. On the figure window, click the "Link/Unlink plot" button, or select menu "Tools", check "Link". On the pop-up...

presque 4 ans il y a | 1

Réponse apportée
how to set port using loop indexing instead of defining every node pair explicitly.
setports(ckt,port_node(1,:),port_node(2,:),port_node(3,:)) or b=mat2cell(port_node,ones(size(port_node,1),1),size(port_node,2)...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Finding the mean of every 24 elements of 3rd dimension of a 3d array
Something like this. Try simple example to make sure the dimension, row, column are right. a=ones(2,3,10); b=mean(reshape(a,2,...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
What do we mean by for example result=uint8(result)
change the data type to uint8 a=1 class(a) b=uint8(a) class(b)

presque 4 ans il y a | 1

Réponse apportée
How to delete inports of a bus creator using script ?
I tried this on a simple example with 8 inports. %% lh=get_param('PathToBusCreator','LineHandles'); in_lh=lh.Inport([6:8]); ...

presque 4 ans il y a | 1

Réponse apportée
Error "Argument to dynamic structure reference must evaluate to a valid field name." What did I wrong?
T_1=linspace(0,160,160); T=T_1+273.15; A= -181.587; B= 8632.13; C= 24.7981; D= 0; H12= 1./(exp(A+(B./T)+(C*log(T))+(...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
How can we understand the "the dimensions of output port" in the sentence?
In the S-function code, you need to define the dimensions (or size) of the outport 2. You must have defined the size of outport ...

presque 4 ans il y a | 0

Réponse apportée
Opening .prj file with MATLAB 2016b
I think the concept of MATLAB Project does not exist in R2016b. I don't remember the exact starting version but the help documen...

presque 4 ans il y a | 1

Charger plus