I'm working on numerical computation methods. I'm new to octave. I download two m files from the internet. Here I just gonna show you the problem-related code, not the whole code.
From funct.m file:
function [ y ] = funct (x)
y=(x*(exp((-x)+3)))-sin((7*x)-4)+(8*x)-20
endfunction
I Think there is no problem there. The error occurred when I tried to plot the function in secant.m file. I've tried two kind of plotting functions. plot() and fplot()
secant.m file:
1.plot():
x=linspace(0,10,20);
plot(x, funct(x));
The error message is nonconformant arguments (op1 is 1x20, op2 is 1x20)
2.fplot():
fplot(funct(x),[0,10],10)
The error message is nonconformant arguments (op1 is 5x1, op2 is 5x1)
How can I fix this error? I'm familiar with other programming language, especially C-like syntax, so feel free to answer it in technical way.
*with.*in declaration offunctory=zeros(size(x))and define eachy(ii)value inforloop. - Crowley