Call a script via a function?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Fred John
am 2 Feb. 2015
Bearbeitet: per isakson
am 2 Feb. 2015
Hi.
Can I call (run) a script in a function? My inputs are elements of a 10x10 matrix. How would I write the output?
0 Kommentare
Akzeptierte Antwort
per isakson
am 2 Feb. 2015
Bearbeitet: per isakson
am 2 Feb. 2015
Look at this
>> cssm
ans =
Greeting from the script
where cssm is the function
function out = cssm()
cssm_script
end
and where cssm_script is the script
% cssm_script
out = 'Greeting from the script';
The script is running in the workspace of the calling function. The effect is the same as if the code of the script was copy&pasted into the calling function.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!