to make a graph(2D), it's super easy. help me!

1 view (last 30 days)
Hi. I'm trying to make 2D graph for the equation of volatility in the range of 0<=x<=1. so I wrote the cords like this.
>> x=[0:1];
>> y=x.*a/{1+x.*(a-1)}
and I also tried these.
x=[0;0.1;0.2;0.3;0.4;0.5;0.6;0.7;0.8;0.9;1];
x=[0:0.1:1];
However, every time I try it, I get the message that 'mrdivide is a defined function in case of 'cell' input arguments.(this might not be certain as I translate it from my native language to English.)
I think it's about matrix problem. Help me!

Answers (1)

Star Strider
Star Strider on 22 Mar 2014
Curly braces ‘{}’ denote cell arrays in MATLAB. I don’t see any reason for you to use a cell here.
Does this do what you want?
x=[0:0.1:1];
a = 5;
y=x.*a./(1+x.*(a-1));
figure(1)
plot(x,y)
grid
  3 Comments
Image Analyst
Image Analyst on 22 Mar 2014
That's so you divide element-by-element instead of doing a matrix divide (inverse).

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!