how can i plot a graph for y vs x?

5 vues (au cours des 30 derniers jours)
reem123
reem123 le 9 Avr 2017
Commenté : Star Strider le 12 Juin 2017
how can i plot a graph for y vs x, for this function a=-(0.1014758667.*sin (x))./(1+0.03063737048.*y.*cos(x)+0.002809.*y.^2) where a=0.5 and x=0:20:360, y=0:0.1:1?
  1 commentaire
reem123
reem123 le 9 Avr 2017
please I need your help

Connectez-vous pour commenter.

Réponse acceptée

Star Strider
Star Strider le 9 Avr 2017
Not possible.
The ‘a’ function has a maximum value of 0.1.
The Code
x=0:20:360;
y=0:0.1:1;
[X,Y] = meshgrid(x,y);
a = @(x,y) (-0.1014758667.*sin(x))./(1+0.03063737048.*y.*cos(x)+0.002809.*y.^2);
A = a(X,Y);
[R,C] = find(A == 0.5)
figure(1)
meshc(X, Y, A)
  54 commentaires
reem123
reem123 le 12 Juin 2017
oooh thank you Ihave to make plot
Star Strider
Star Strider le 12 Juin 2017
Change your figure call to a figure and plot call:
figure
plot(x,br)
That worked when I ran it with the rest of your code, and produced an acceptable plot.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by