Matlab

pseudo_matlab Messages postés 2 Date d'inscription   Statut Membre Dernière intervention   -  
Ponps123 Messages postés 16 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
j'ai un problème de tracer un courbe sur matlab, il m'affiche une erreur
je veux tracer X_svg
avec t=0:300 (alors de dimension(1,301)) et Xsvg de dimension(3,10)

c'est quoi le problème?

??? Error using ==> plot
Vectors must be the same lengths.

Error in ==> k at 66
plot(t,X_svg(:),'g');

merci de me répondre :)
s'il vous plait

1 réponse

Ponps123 Messages postés 16 Date d'inscription   Statut Membre Dernière intervention   10
 
Bonjour,

Alors pour faire simple, la fonction plot va prendre en x les points de t et en y ceux de X_svg.
Donc déjà ton X_svg à 3 dimensions donc Matlab essaiera de tracer 3 courbes...
Ensuite X_svg a 10 coordonnées y pour t qui en a 301. Il y a donc un problème de taille.
A quoi correspond ton X_svg ? 3 courbes ?

PS: Voici ce que help plot te donne...
If one of X or Y is a vector and the other is a matrix, then the matrix must have dimensions such that one of its dimensions equals the vector length. If the number of matrix rows equals the vector length, then MATLAB plots each matrix column versus the vector. If the number of matrix columns equals the vector length, then MATLAB plots each matrix row versus the vector. If the matrix is square, then MATLAB plots each column versus the vector.
0