why does the command window say my file is not found
Show older comments
%%
sim('Lab1.slx')
figure
subplot(2,2,1)
plot(tout, Acceleration.Data, 'k-')
xlabel('Time')
ylabel('Acceleration')
grid on
subplot(2,2,2)
plot(tout, Velocity.Data, 'r-')
xlabel('Time')
ylabel('Velocity')
grid on
subplot(2,2,3)
plot(tout, Displacement.Data, 'r-')
xlabel('Time')
ylabel('Displacement')
grid on
Error using VibrationsLab1 (line 2)
No system or file called 'Lab1.slx' found.
I have a simulink model in the same directory as this .m file but when i run the code it says that the simulink file wasn't found
Answers (1)
Fangjun Jiang
on 18 Dec 2022
0 votes
Could be a Lab1.mdl file. Try this
open_system('Lab1');
sim('Lab1');
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!