antonio palestrini wrote:
either: z=inline(q); z(5)
or: inline(q)(5);
wonderful short code!!!!
It works, even in my octave 2.1.69, with many parameters in the string!
And you don't have to remember upper case of parameters :-)
[oct 8] q="2-k+h+f-g";
[oct 9] z=inline(q)(5,2,2,2)
z = 5
Dear Doug,
the help of inline says that arguments are extracted
in alphabetic order ("i" and "j" are not considered) so for people
like me that are usually so abstracted is better to write
q= "2 + f - g + h - k
have a good work!
antonio
inline is really deprecated in matlab/octave and function handles should
be used... Note though that you can explicitly state what the variables
are including their order. Consider
octave:3> inline('y-x','y','x')(2,1)
ans = 1
octave:4> inline('y-x')(2,1)
ans = -1
D.
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave