How to compare two Bode plots, using function matlab and csv file ?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have file csv with the results of measurements of the Bodego plot made in the PSpice program. In Matlab, I design the theoretical course using the transmistance of the tested circuit using the bode () function.
I would like to apply these values from the csv file to the theoretical chart and show the similarity.
My transmittance is G. Below is the code that draws the theoretical course.
s = tf('s');
Rs = 10;
R = 100;
C = 20*(10^-4);
G = Rs + (1/((1/R)+s*C))
bode(G, logspace(0,9))
title ('Wykres Bodego')
xlabel('Częstotliwość')
axes=findobj('type','axes')
h_magnitude=get(axes(2),'YLabel')
h_phase=get(axes(1),'YLabel')
set(h_magnitude,'String','Amplituda [dB]')
set(h_phase,'String','Faza [stopnie]')
grid on
I only know how to insert a csv file, but I have no idea how to combine these two graphs and whether it can be done at all. I enclose a csv file
file_name = 'Bode.csv';
fid = fopen(file_name,'r');
data = csvread(file_name,3,0);
fclose(fid);
f=log10(data(:,1));
gain=data(:,3);
phase=data(:,2);
I would be grateful for your help
0 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!