17
edits
Line 98: | Line 98: | ||
plot(x1,y) | plot(x1,y) | ||
grid minor on | grid minor on | ||
* '''Demo of how to suppress a warning about converting from floating point numbers to symbolic numbers. | |||
## Demo of how to use a number (which was calculated in an octave | |||
## variable) in a symbolic calculation, without getting a warning. | |||
## use octave to calculate some number: | |||
a=pi/2 | |||
## now do some work with the symbolic pkg | |||
syms x | |||
f = x * cos(x) | |||
df = diff(f) | |||
## Next get the number into a symbolic variable | |||
## convert to string first | |||
aa=mat2str(a) | |||
## and now to a symbolic variable. | |||
ww=sym(aa) | |||
## and now use it | |||
vpa(subs(df, x, ww), 28) | |||
</source> | </source> |
edits