Code covered by the BSD License

# MATLAB para Ensino

### Elia Matsumoto (view profile)

Slides and demo files from the webinar "MATLAB for Teaching' (Portuguese).

grafico_espectro_de_potencia.m
```function grafico_espectro_de_potencia(X1, Y1, Y2)
%grafico_espectro_de_potencia(X1, Y1, Y2)
%  X1:  vector of x data
%  Y1:  vector of y data
%  Y2:  vector of y data

%  Auto-generated by MATLAB on 12-Jul-2007 15:16:25

% Create figure
figure1 = figure('PaperSize',[20.98 29.68]);

% Create subplot
subplot1 = subplot(1,2,1,'Parent',figure1);
% Uncomment the following line to preserve the X-limits of the axes
xlim([0.5 1.3]);
box('on');
grid('on');
hold('all');

% Create plot
plot(X1,Y1,'DisplayName','Movimento ao longo da direo Y','Parent',subplot1,...
'Color',[0 0 0]);

% Create xlabel
xlabel('Frequencia (Hz)');

% Create ylabel
ylabel('Espectro de Potncia');

% Create legend
legend1 = legend(subplot1,'show');
set(legend1,'TextColor',[0 0 1]);

% Create subplot
subplot2 = subplot(1,2,2,'Parent',figure1);
% Uncomment the following line to preserve the X-limits of the axes
xlim([0.5 1.3]);
box('on');
grid('on');
hold('all');

% Create plot
plot(X1,Y2,'DisplayName','Movimento ao longo da direo X','Parent',subplot2,...
'Color',[0 0 0]);

% Create xlabel
xlabel('Frequencia (Hz)');

% Create ylabel
ylabel('Espectro de Potncia');

% Create legend
legend2 = legend(subplot2,'show');
set(legend2,'TextColor',[0 0 1]);

```