[Scilab-users] please help me correct this file?
Dang, Christophe
Christophe.Dang at sidel.com
Mon Jan 14 09:34:20 CET 2013
Hello Naasik,
> could you please help fix the attached script. it is a basic program
> just to test my logic interlocking and my basic math functions of scilab.
Hello,
If I may give some advice:
> for a=input("select your shape?")
> end
I would simply write
a=input("select your shape?")
> horner(d,x)
horner is to evaluate a polynomial, and you did not define a polynomial
in Scilab sense. When you write
> [d]=(x)
you juste define a matrix -- [...] -- containing d, and say its equal
to x. You should write something like
x = poly(0, 'x')
d = x
meaning that the variable "x" is the polynomial built on the
indeterminate x with the root 0, i.e. P(x) = x,
then d = P(x) ( = x)
When you write
> function e(c)=c^2
> endfunction
You should write it at the beginning of the script, in the following way :
function [y] = e(x)
y = x^2
endfunction
(here, x is a local variable, not the monomial defined above)
and then use in the main program body
e(c)
or,if you want to use horner, define a polynomial as above
e = x^2
horner(x, c)
(remember x was already defined)
Hope this helps.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
More information about the users
mailing list