The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 69
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 " <> wrote in message <k9i5sn$atc$>...
> 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
Read Midpoint Method
Read Re: Midpoint Method

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.