Open and run a .m in matlab into an another .m file
118 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ivan Mich
el 2 de Abr. de 2020
Comentada: Ivan Mich
el 2 de Abr. de 2020
Hello,
I have a quastion about a code I am creating. I have a code in a .m file, let's name it as "first.m". But in the "first.m" i would like to write a command in this script in which I would like to run and execute an another .m file, let's name it "second.m" file, in the ssame directory.
Could anyone help me to make it?
0 comentarios
Respuesta aceptada
Walter Roberson
el 2 de Abr. de 2020
Inside first.m code a line
second; %invokes second.m
This will work provided that second.m is on your MATLAB path (such as being in the same directory). If it is not on your MATLAB path and it is a script (rather than a function) then you can use
run('appropriate/directory/goes/here/second.m')
4 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!