Error using input, cannot call INPUT from EVALC
古いコメントを表示
Hi, I was trying to write a function that calculate some statistic thing Here is my code
xmin = input('Input the min value for x: ');
xmax = input('Input the max value for x: ');
xspace = input('Input the increment for x: ');
x = xmin:xspace:xmax;
equation = input('Input the equation: ','s');
f = eval(equation);
F(xmin) = f(xmin);
for j = xmin +1 : xspace: xmax,
F(j) = f(j) + F(j-1);
end
ymax = max([max(f), max(F)]);
ymin = min([min(f), min(f)]);
subplot (2,1,1); p = plot(x, f,'k'); set(p,'LineWidth',2); %k means black
xlabel('x'); ylabel('f(x)'); title('Probability Density Fuction');
axis([xmin,xmax,ymin,ymax]); grid;
subplot (2,1,2); p = plot(x, F,'k'); set(p,'LineWidth',2); %k means black
xlabel('x'); ylabel('F(x)'); title('Cumulative Distribution Fuction');
axis([xmin,xmax,ymin,ymax]); grid;
When I try to run this code, I don't have any problem, however when I try to publish the same code using matlab cloud I got some errors
Error using input Cannot call INPUT from EVALC.
Error in cdfpdf (line 1) xmin = input('Input the min value for x: ');
Also I can't run this code in matlab cloud, gave me a bunch of errors, I don't understand what these errors mean. Any help would be appreciated. Thanks in advance.
2 件のコメント
Walter Roberson
2013 年 1 月 20 日
Huh. Sure enough, evalc('input()') is not allowed.
Jan
2013 年 1 月 20 日
How can we help you with the bunch of errors, when we do not see the corresponding messages?
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!