Graph line not showing

11 visualizaciones (últimos 30 días)
Henry Balmain
Henry Balmain el 6 de Sept. de 2020
Respondida: Asad (Mehrzad) Khoddam el 6 de Sept. de 2020
So I have an equation and some variables to substitute in for, but I cannot get my graph to have a line. I know others have asked similar questions but I am stuck.
X = 20;
P = 20;
r = 20;
theta = 30;
y = ((X*P)./(2*pi*r.^2))*cos(theta).^(X-2);
plot(y)

Respuestas (1)

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam el 6 de Sept. de 2020
Several issues in your code:
1- it has only one point (use plot(x, y) )
2- The angle should be in radians not degrees. For angles in degrees you can use 'cosd' instead of 'cos'

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by