Bode Plot over time and frequency
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello
I have a problem with a 3D-Bode Plot. The result i want to have is: http://img849.imageshack.us/img849/5048/sam0576i.jpg
![](https://www.mathworks.com/matlabcentral/images/broken_image.png)
A family of logarithmic respones over time and frequency.
The code in Matlab is:
clear
w_min = 10^(-1);
w_max = 10^3;
mag_min = -30;
mag_max = 50;
mag_step = 20;
phs_min = -180;
phs_max = 45;
phs_step = 45;
t=linspace(0,40,100);
figure;
w=logspace(log(w_min),log(w_max),100);
for i=1:length(w)
TF = tf(1,[0.0625 0.2 1]);
[mag,phs] = bode(TF,w);
magdb = 20*log10(mag);
magdb
z(i,:)=magdb(1,1,:);
end
[X,Y] = meshgrid(t,w);
Z = griddata(t,w,z',X,Y);
surf(X,Y,Z);
xlabel('time (s)');
set(gca, 'yscale','log','YDir','reverse');
ylabel('Magnitude frequency (1/s)');
ylim([w_min,w_max]);
zlabel('Amplitude [db]');
zlim([mag_min mag_max]);
set(gca,'ZTick',mag_min:mag_step:mag_max);
As you can see there is no (t) in the loop and I dont know how to build it in. How to put the loop over time in the frequency loop.
I would be grateful for some advice or example codes.
0 comentarios
Respuestas (1)
Fangjun Jiang
el 22 de Ag. de 2011
Those are multiple Bode plots plotted together. There must be some parameters of the transfer function changed over the time which result in the different Bode plots. You didn't have anything changed over the time in your code. What is supposed to change over the time? Bode plot itself won't change over time.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!