graph not displaying with UIaxes

2 visualizaciones (últimos 30 días)
Shu-An Hsieh
Shu-An Hsieh el 20 de Sept. de 2021
Respondida: Geoff Hayes el 21 de Sept. de 2021
x = 0:1:30;
y = ((30^x)*exp(-30))/factorial(x);
plot(app.UIAxes,x,y);
the graph is not plotting, can anyone assist with this.

Respuestas (1)

Geoff Hayes
Geoff Hayes el 21 de Sept. de 2021
Shu-An - when I run your code, I see the following error
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is
a scalar. To perform elementwise matrix powers, use '.^'.
Error in yy (line x)
y = ((30^x)*exp(-30))/factorial(x);
If you do an elementwise operation, try changing your y assignment to
y = ((30.^x)*exp(-30))./factorial(x);

Categorías

Más información sobre Directed Graphs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by