![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1391079/image.png)
How to output a tout from Simulink space to Matlab so that it reads the value to us?
58 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
During the simulink simulation, I have a problem with the derived "tout" in m-matlab file gives me an error "Unrecognized function or variable 'tout'." but tout is in the workspace in ANS, I wanted to draw the graphs in matlab and I derived "OUT" from the simulink, and "tout" from the simulation. Please help me and best regards.
sim('cw_6_silnik') % simulink file name
t=tout;
delta=yout(:,1);
n=yout(:,2);
T_e=yout(:,3);
T_a=yout(:,4);
P_e=pi/30*T_e.*n;
figure(1)
plot(t,delta,'b'), grid on
xlabel('t [s]')
ylabel ('\delta [deg]')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1391059/image.png)
0 commentaires
Réponses (2)
Askic V
le 23 Mai 2023
Modifié(e) : Askic V
le 23 Mai 2023
I use to Workspace block in simulink and choose Array option, just like shown in the image below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1391079/image.png)
% Check if out variable is accessible in Workspace
whos out
% Plot
plot(out.time, out.output);
hold on:
plot(out.time, out.input);
hold off;
0 commentaires
Voir également
Catégories
En savoir plus sur Simulink Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!