How did I get this crazy Plot?

1 次查看(过去 30 天)
Learner
Learner 2018-5-11
编辑: Dennis 2018-5-11
clc
clear all
close all
A = 1.9;
R = 10;
a = 1;
X = linspace(0.0001,0.1,100);
% Y = a.*(1 + (A^(-R))*(X.^(R-1)));
for i = 1:length(X)
Y(i) = a*(1 + (A^(-R))*(X(i)^(R-1)));
end
plot(X, Y)
If you run the above code you will get a weird plot like this (shown below).
  1. How come those many ones in the Y-axis?
  2. Instead of a straight line, How come the plot it is a curve?
  • Could anybody please explain??*
  3 个评论
Learner
Learner 2018-5-11
Yes, Solved. Thanks a lot...
Guillaume
Guillaume 2018-5-11
This is the plot I get (R2018a).
I see nothing unusual about it and I don't understand why you expect a straight line when you're effectively plotting y = c1*x.^9 + c2.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by