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

Huh. Sure enough, evalc('input()') is not allowed.
Jan
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에 대해 자세히 알아보기

태그

질문:

2013년 1월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by