Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

[X,erreur]=calcul_spectre_X(s,N,fe)
function [X,erreur]=calcul_spectre_X(s,N,fe)


X=zeros(N,1);
te=1/fe;
V=[];
erreur=0;
if s(end)~=';'
    s=[s,';'];
end;
test=findstr(s,'X');
if isempty(test)
    V=uicontrol(gcf,'style','text','unit','normalized',...
                        'position',[0.1 0.5 0.8 0.05],'backgroundcolor','w',...
                        'foregroundcolor','r','string','SPECTRE DEFINI PAR X(...)=...','fontunits','normalized','fontsize',0.5,'fontweight','bold');
   erreur=1;
else
    try
        eval(s)
        h=get(gcf,'child');
        lh=length(h);
        ha=[];
       for kh=1:1:lh
            s_type=get(h(kh),'type');
            if strcmp(s_type,'uicontrol');
                ha=[ha;h(kh)];
            end;
        end;
        for ka=1:1:length(ha)
            s_texte=get(ha(ka),'string');
            place=findstr(s_texte,'ERREUR');
            if ~isempty(place)
                delete(ha(ka));
            end;
            place=findstr(s_texte,'SPECTRE DEFINI');
            if ~isempty(place)
                delete(ha(ka));
            end;
        end;
      
    catch
        V=uicontrol(gcf,'style','text','unit','normalized',...
                        'position',[0.1 0.5 0.8 0.05],'backgroundcolor','w',...
                        'foregroundcolor','r','string','ERREUR DE PROGRAMMATION !','fontunits','normalized','fontsize',0.5,'fontweight','bold'); 
        erreur=1;            
    end;
end;

Contact us