Export Bode Plot Data to Excel or text file

16 vues (au cours des 30 derniers jours)
VIJETH DSOUZA
VIJETH DSOUZA le 24 Mar 2014
Modifié(e) : Patrik Ek le 24 Mar 2014
Is it possible to export Bode Plot data to excel or text file?
Or is there any other way to obtain complete data of bode plot?
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 24 Mar 2014
How did you get the bode plot?

Connectez-vous pour commenter.

Réponses (2)

Patrik Ek
Patrik Ek le 24 Mar 2014
Modifié(e) : Patrik Ek le 24 Mar 2014
Given the data you can export a matrix or a cell array of data using xlswrite. If you have a matrix you can just use
xlswrite(filename,data) % data is a MxN matrix and gives MxN excel cells.
Otherwise if you want to export strings or want some kind of structure of the excel file you can have a cell with data,
xlswrite(filename,data) % data is a cell and each matlab cell gives an excel cell.
which allows you to do something like
freq amp
0.1 0
1 0
10 -3
... ...
If you have a matrix which you want to transform to a cell use mat2cell.
However I am not sure what you mean with "obtain the complete data of the bodeplot". Since you did say you wanted to export it, I would say this requires that you already have the complete data or otherwise specify the missing data, which should be possible to obtain in matlab. Also if you, with obtain, meant that you wanted to "store" the data, I would recommend that you uses matlabs save if you want to save it for new use in matlab, xlswrite if you want to use it in excel and fprintf to write it to a .txt file.

Azzi Abdelmalek
Azzi Abdelmalek le 24 Mar 2014
Modifié(e) : Azzi Abdelmalek le 24 Mar 2014
I don't know how you get a bode plot, if like below:
% N=1;
% D=[1 10];
[a,p,w]=bode(N,D)
subplot(2,1,1)
plot(log10(w),20*log10(a)) % Amplitude
subplot(2,1,2)
plot(log10(w),p) % Phase
%---save data to Excell file------------
M=[log10(w) 20*log10(a) p] % frequencies amplitudes and phases
xlswrite('YourFileName.xlsx',M)

Catégories

En savoir plus sur Data Export to MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by