# Doug's MATLAB Video Tutorials

## Expression evaluation in MATLAB

MATLAB is constantly evaluating expressions and expressions within expressions. A lot of MATLAB users do not think about this, or the implications. Simple examples of using a vector as the index into a for loop instead of one that is dynamically created (1:10 for example) is shown. Also, the use of a variable as an input to a function expecting a string is shown.

 Name (required) E-mail (required, will not be published) Website (optional) Spam protection (required): What is 8 + 10 ?

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>


If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).

Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.

These postings are the author's and don't necessarily represent the opinions of MathWorks.