graph not displaying with UIaxes

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.

답변 (1개)

Geoff Hayes
Geoff Hayes 2021년 9월 21일

0 개 추천

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);

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2021년 9월 20일

답변:

2021년 9월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by