Call a script via a function?
조회 수: 6 (최근 30일)
이전 댓글 표시
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
채택된 답변
per isakson
2015년 2월 2일
편집: per isakson
2015년 2월 2일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!