How to plot the bode plot extracted from LTspice in Matlab?
Afficher commentaires plus anciens
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')
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Data Import and Export dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
