Simulink from workspace block
Mostrar comentarios más antiguos
Hello,
I am new to using simulink and not sure how it works entirely. I am trying to do a simple task of passing values in real time to simulink. I want my data from my for loop to be passed into simulink and displayed there.
My issue is that not all vector values are being transfered to simulink.
My code is:
x = ones(1,5);
n = 5;
for i = 1:n
angles = randi([0 180], [1 5]);
data = angles;
sim('ardsim2013');
end
('ardsim2013' is the simulink file and only has the "From workspace" source block and leads into "Display" block)
I am trying to pass the angles vector into simulink however the first number from "angles" gets cut off when passed into simulink and the display block reads only 4 values instead of 5.
i.e. I want
angles = [1 2 3 4 5]
to be passed into simulink but
angles = [2 3 4 5]
are the only values that are displayed and passed into simulink.
How can I fix this so that the whole vector is passed?
Thank you.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Array and Matrix Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!