Simple for loop in Simulink

3 visualizaciones (últimos 30 días)
Gazi Taspinar
Gazi Taspinar el 8 de Abr. de 2021
Respondida: Abhishek Gupta el 12 de Abr. de 2021
Hello,
I have a R matrix whose dimension is Nx3. N will be given by user. How can I implement following Matlab code in simulink without using Matlab function block? I want to use for loop.
R=zeros(N,3)
dR=zeros(N-1,3)
for i=1:1:N-1
dR(i,:)=R(i+1,:)-R(i,:)
end
%% THANKS

Respuestas (1)

Abhishek Gupta
Abhishek Gupta el 12 de Abr. de 2021
Hi,
You can use a For Iterator Subsystem block. Referring to the following documentation, which might help you achieve the mentioned task: -

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by