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 comentarios

Walter Roberson
Walter Roberson el 20 de En. de 2013
Huh. Sure enough, evalc('input()') is not allowed.
Jan
Jan el 20 de En. de 2013
How can we help you with the bunch of errors, when we do not see the corresponding messages?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Graphics Performance en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de En. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by