How to do running another .m file that calls this .m file?

2 次查看(过去 30 天)
x = [5 10 12 3];
y = [11 8 3 3];
plot(x,y, 'g')

回答(1 个)

Chunru
Chunru 2021-12-9
Save the followint into a file, for example, 'my_script.m':
x = [5 10 12 3];
y = [11 8 3 3];
plot(x,y, 'g')
In a separate script, for example, 'another_script.m':
run('myscript.m') % to run your first script in second script

类别

Help CenterFile Exchange 中查找有关 Files and Folders 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by