Math Lab

Statut
N'est pas ouverte pour d'autres réponses.

GaZou

Touriste
Voila

t = 0:pi/100:2*pi;
y = sin(t);
plot(t,y)
grid on % Turn on grid lines for this plot


voila j ai un truc bizare en fait je pige po ce ke défini exactement le T me doute bien ke c est le domaine de la fonction mais pq ou met po bettement t = O : 2*pi ??
ke vient fair le pi/100 kelk un sait me dire a kwa conrespond exactement tout ca :) merchi
 

Vorsarius

Yeah well..
ton "t" corresponds aux valeurs que matlab va utiliser pour calculer ta fonction; ici, on assigne à "t" des valeurs de 0 à 2pi par incrément de pi/100, autrement dit t=(0.0314, 0.0628, 0.0942,... 6.28 ) ;)
 
1er
OP
GaZou

GaZou

Touriste
extra merci :) je vais tester :)
 
1er
OP
GaZou

GaZou

Touriste
>> x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
>> plot (x,y)
>> x = -pi:pi/9:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>>

mais pq il me met ca kan je change l increment ?
 
1er
OP
GaZou

GaZou

Touriste
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>> x = -pi:pi/5:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>> x = -pi:pi/100:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>>
 

Banach

Touriste
Oui il va calculer tout les pi/100 entre tes deux points. C'est le niveau de précision en quelque sorte, je me trompe?
 

Banach

Touriste
GaZou a dit:
>> x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
>> plot (x,y)
>> x = -pi:pi/9:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>>

mais pq il me met ca kan je change l increment ?
Mais la tu dois pas redéfinir tu x apres. Tu pourrais mettre 0,1 a la place de pi/9, ca ne change rien pour toi.

GaZou a dit:
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>> x = -pi:pi/5:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>> x = -pi:pi/100:pi;
>> plot (x,y)
??? Error using ==> plot
Vectors must be the same lengths.

>>
Et ici tu ne définis pas de fonction y, retape la ligne avec ton y.
 
Statut
N'est pas ouverte pour d'autres réponses.
Haut