Connecting various matlab code files.
Mostrar comentarios más antiguos
Hi,
If I have a bunch of files in matlab and want one of the files to call some other file, how do I do so. Do I need to put all the files in the same folder. For example I have 1.m and 2.m and in 1.m I would like to use a function of 2.m(or something related to that) how do I go about it.
Thanks in advance
Respuestas (1)
Matt J
el 4 de Oct. de 2012
0 votos
You can put the files in different folders, but both folders need to be on the MATLAB path. See ADDPATH, PATHTOOL, and other related functions for ways to modify your path.
2 comentarios
mmomudnet momo
el 4 de Oct. de 2012
Matt Kindig
el 4 de Oct. de 2012
If 2.m and 1.m are both on the path, you can simply call the function 2.m while running 1.m-- no references are necessary.
Categorías
Más información sobre Search Path en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!