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

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2022 年 12 月 18 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

質問済み:

2022 年 12 月 18 日

回答済み:

2022 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by