How to call one program from another in MATLAB?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have to call a program/ module from another. If possible please give an example. Say, there's a program which sends integers from 1 to 10 to another program, and the other program adds 2 to each integer that it gets and prints it.
0 comentarios
Respuesta aceptada
Matt Fig
el 3 de Abr. de 2011
Save this first function in one M-file (copy and paste it, then save it):
function [] = receives_integers()
% Prints integers it gets.
INT = sends_integers; % Call the other function.
for ii = 1:length(INT)
disp(INT(ii)+2)
end
And then save this next function to another, separate M-file:
function INT = sends_integers()
% Sends 1 through 10.
INT = 1:10;
Now from the command line, type this and hit return:
receives_integers
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!