Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Midpoint Method
Replies: 1   Last Post: Dec 7, 2012 8:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Kristin

Posts: 67
Registered: 2/22/12
Re: Midpoint Method
Posted: Dec 7, 2012 8:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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


Date Subject Author
12/3/12
Read Midpoint Method
faizal
12/7/12
Read Re: Midpoint Method
Kristin

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.