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: Options - Derivatives
Replies: 1   Last Post: Jan 18, 2013 11:15 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Roger Stafford

Posts: 5,929
Registered: 12/7/04
Re: Options - Derivatives
Posted: Jan 18, 2013 11:15 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Pallav Mishra" wrote in message <kdd57c$d79$>...
> I am trying to plot an intrinsic value of a call option, which is max(S-K,0), with
> strike $50, and stock price changes from $0.01 to 100..wanted to know how to do this right, because its throwing an error. Its obvious that plot (x,y) should have x and y of the same length:

> >> plot( 0.01:0.01:100, max(0.01:0.01:(100-50),0),'b')
> Error using plot
> Vectors must be the same lengths.

- - - - - - - - - -
I am guessing you want this:

x = 0.01:0.01:100;
y = max(50-x,0);

Roger Stafford

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.