Putting array in function to graph

조회 수: 3 (최근 30일)
Kris Comeaux
Kris Comeaux 2021년 9월 16일
편집: KSSV 2021년 9월 16일
I am trying to graph this using the M array as input values
%For graph
x = 0 : 0.1 : 2;
y = 0.7*(x.^2)*(1+0.2*(x.^2))^-3.5
figure(1)
plot(x,y)
grid
This error is returned:
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 aero (line 3)
y = 0.7*(x.^2)*(1+0.2*(x.^2))^-3.5
It was also not working trying to retrive N's values and not graphing. What am I doing wrong?

답변 (1개)

KSSV
KSSV 2021년 9월 16일
편집: KSSV 2021년 9월 16일
x = 0 : 0.1 : 2;
y = 0.7*(x.^2).*(1+0.2*(x.^2)).^-3.5 ;
y = 1×21
0 0.0070 0.0272 0.0592 0.1003 0.1475 0.1976 0.2473 0.2939 0.3352 0.3698 0.3967 0.4157 0.4270 0.4311 0.4290 0.4216 0.4098 0.3947 0.3771 0.3579
figure(1)
plot(x,y)
grid

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by