Simulink subtraction of consecutive rows from a matrix
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everybody,
I have a problem with substracting of consecutive rows from a matrix. I have a matrix R whose dimension is Nx3 where N is inputted by user. For example;
If N=2;
I have 2x3 matrix. My intention is to find R(2,3)-R(1,3).
I tried to use vector index inside a for loop but I got error about dimensions. I get following error.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576412/image.png)
My simulink model is as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576417/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/576422/image.png)
Could anyone help me please?
0 Commenti
Risposte (1)
Michael Savitz
il 6 Ago 2021
Hi Gazi,
It appears that your model is using the Index Vector block to select rows of the matrix R. The Index Vector block does not support matrix inputs. See https://www.mathworks.com/help/simulink/slref/indexvector.html.
Instead, you may want to use the Selector block. See https://www.mathworks.com/help/simulink/slref/selector.html.
Hope this helps,
Michael
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!