I have a code written in Scilab:
function v=myhorner2(a,x)
N=length(a)
v=a(1)
for i=2:N do
v=v*x+a(i))
end
endfunction
which is working well. Now I need to do the recursion with the same code, but it seems that it's not working - where's the mistake?
function myhorner2(a,x)
if i=2:N then
myhorner2(a,x)
disp (i=2:i+1)
myhorner2(a+1,x)
else
disp ([v=a])
end
endfunction
I'm a beginner. Thanks for your feedback