Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Kristin
Posts:
59
Registered:
2/22/12
|
|
Re: Midpoint Method
Posted:
Dec 7, 2012 8:54 AM
|
|
"faizal " <bb_zal@yahoo.com> wrote in message <k9i5sn$atc$1@newscl01ah.mathworks.com>... > > fcnstr='x^2 - 3*x^3 + 0.5*x^4' ; > > %Converting the input function to that can be used > f=inline(fcnstr) ; > > "??? Error using ==> inline.subsref at 17 > Too many inputs to inline function. > Error in ==> Untitled18 at 47 > ka=f(xr(i),yr(i));" > Mind to explain to me what the probelm here...i'm a newbie using Matlab
Look at fcnstr. Notice that it only has x's as variables, so when you create the inline function, there is only one variable, so only 1 argument.
Somewhere after you make the function f, type "keyboard" and run your code. You will be stopped at this line. Then, in your command window, type "f", and you'll see what it looks like:
f =
Inline function: f(x) = x^2 - 3*x^3 + 0.5*x^4
|
|
|
|