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: 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,852
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$1@newscl01ah.mathworks.com>...
> 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);
plot(x,y)

Roger Stafford



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.