How to plot the bode plot extracted from LTspice in Matlab?
Mostrar comentarios más antiguos
Hello,
I'm trying to use matlab to plot the bode plot exported from LTspice. The .txt file as well as my code is added below. I found there maybe something wrong in the 'fopen' and 'textscan' part since there are no values for Dc and D, but I can't fix it. I really appreciate it if anyone can tell me how to solve it.
clc;
close all;
clear all:
fidi = fopen('CM filter.txt');
Dc = textscan(fidi, '%f (%f dB,%f °)','CollectOutput',1);
D = cell2mat(Dc);
figure
subplot(2,1,1)
semilogx(D(:,1), D(:,2))
title('Amplitude (dB)')
grid
subplot(2,1,2)
semilogx(D(:,1), D(:,3))
title('Phase (°)')
grid
xlabel('Frequency')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Import and Export en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
