Tracer des vecteur sur matlab

Fermé
kader83 Messages postés 17 Date d'inscription mercredi 13 février 2008 Statut Membre Dernière intervention 17 mai 2013 - 2 avril 2009 à 13:09
Bonjour,
j'ai ecris un programme sur dev-c++ et je veux tracer les vecteur calculer sur matlab et je ne sais pas comment faire ,es ce que quelqu'un peu m'aider????
j'attend votre reponse merci
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char *argv[])
{   /* declaration des constantes*/
    
    float f,pi,v;
    f=50;
    pi=3.14;
    v=220;
    float T,t,pas,alpha,R;
    T=1/f;
    int N,p;
    pas=0.001;
    N=T/pas;
    t=0;
    alpha=0.01;
    R=2;
    float tt[N];
    float vt[N];
    float is[N];
for (p = 0 ; p < N ; p++)
{    
    tt[p]=t;
    vt[p]=sqrt(2)*220*sin(2*pi*f*t);
    
    
/*******************************************/    
           if ( t >0  && t < alpha*T/2*pi )
              {
               is[p]=0;
               
              }
           if ( t >alpha*T/2*pi  && t < T/2 )
              {
               is[p]=(v*sqrt(2)*sin(2*pi*f*t))/R;
               
              }
           if ( t >T/2  && t < T )
              {
              is[p]=0;
               
              } 
     t=t+pas; 
}    
    // Affichage de ses valeurs pour vérifier
    printf("tt           vs            is \n");
    for (p = 0 ; p < N ; p++)
    {
        
        printf("%lf     %lf     %lf \n", tt[p]  , vt[p] ,  is[p]);
    }


    system("PAUSE");
    return EXIT_SUCCESS;
}