28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

g(t) = t^2<br />

You can convert the result to a string using the char function.<br />

char(g)<br />

ans =<br />

t^2<br />

Example 2. This example creates an inline function to represent the formula<br />

f 3 2x. The resulting inline function can be evaluated with the<br />

argnames and formula functions.<br />

2<br />

=<br />

sin(<br />

)<br />

f = inline('3*sin(2*x.^2)')<br />

f =<br />

Inline function:<br />

f(x) = 3*sin(2*x.^2)<br />

argnames(f)<br />

ans =<br />

'x'<br />

formula(f)<br />

ans =<br />

3*sin(2*x.^2)ans =<br />

Example 3. This call to inline defines the function f to be dependent on two<br />

variables, alpha and x:<br />

f = inline('sin(alpha*x)')<br />

f =<br />

Inline function:<br />

f(alpha,x) = sin(alpha*x)<br />

If inline does not return the desired function variables or if the function<br />

variables are in the wrong order, you can specify the desired variables<br />

explicitly with the inline argument list.<br />

inline<br />

2-1175

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

Saved successfully!

Ooh no, something went wrong!