why does the command window say my file is not found

%%
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

Réponses (1)

Fangjun Jiang
Fangjun Jiang le 18 Déc 2022

0 votes

Could be a Lab1.mdl file. Try this
open_system('Lab1');
sim('Lab1');

Catégories

En savoir plus sur File Operations dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by