Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Writing a function (.m executable) - how do I perform tasks on my workspace variables?

조회 수: 1 (최근 30일)
Pocho
Pocho 2011년 12월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
I have arrays called "Blah1", "Blah2", etc., in the workspace, and I want to write a function that finds the max of "Blah1", etc., and writes these max values to a text file.
I am not sure how to indicate in the .m file that I am performing the function on 'Blah." I'm good with the writing to a text file part.
Ideas?
Thanks,
Pocho

답변 (2개)

Naz
Naz 2011년 12월 3일
pass your blah matrix as an argument to your function:
yourfunction(blah1,blah2);

Walter Roberson
Walter Roberson 2011년 12월 3일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by