23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3 Basic Program Components<br />

Evaluating in Another Workspace Using evalin. Functions can also<br />

obtain variables from either the base or the caller’s workspace using the<br />

evalin function. The example below, compareAB_1, evaluates a command in<br />

the context of the <strong>MATLAB</strong> command line, taking the values of variables A<br />

and B fromthebaseworkspace.<br />

Define A and B in the base workspace:<br />

A = [13 25 82 68 9 15 77]; B = [63 21 71 42 30 15 22];<br />

Use evalin to evaluate the command A(find(A

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!