Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

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

Asked by Pocho on 3 Dec 2011

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

0 Comments

Pocho

Products

No products are associated with this question.

2 Answers

Answer by Naz on 3 Dec 2011

pass your blah matrix as an argument to your function:

yourfunction(blah1,blah2);

0 Comments

Naz

Contact us