Bode Plot data extraction to xlsx file format
이전 댓글 표시
The coefficinets a1,a2, b1, b2 k1, k2 are computed using some arithmetic calculations according to some specific requirement. After the computation Bode plot is done for High pass, Notch and Low pass filters. The requirement for me is to obtain the data of the bode plot (corresponding magnitude vs frequency and phase vs freq) in to a csv file or text file.
Bode plot respons is as expected and the problem I am facing for the
xlswrite('data.xlsx', [dat1,dat2,dat3]) command is Input data must be a numeric, cell, or logical array.
Even in the Data Statistics tab the values are displaying as NaN
Can somebody suggest a solution or workaround ?
Code:
%HighPass Filter
Vin=[1 a1 a0];
V01=[0 ((-(k2*b2*a1))+(k2*b1)) ((-k2*b2*a0)+(k2*b0))];
LP=tf(V01,Vin)
opts = bodeoptions;
opts.FreqUnits = 'kHz';
dat1=bodeplot(LP,opts,'r');
hold on
%Notch Filter
Vin=[1,a1,a0];
V02=[b2,b1,b0];
HP=tf(V02,Vin)
opts = bodeoptions;
opts.FreqUnits = 'kHz';
dat2=bodeplot(HP,opts,'b');
hold on
%Low Pass Filter
Vin=[(K1*sqrt(a0)) (a1*(K1*sqrt(a0))) (a0*(K1*sqrt(a0)))];
V03=[0 ((b0-(b2*a0))) ((a1*b0)-(a0*b1))];
BN=tf(V03,Vin)
opts = bodeoptions;
opts.FreqUnits = 'kHz';
dat3=bodeplot(BN,opts,'g');
hold off
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Plot Customization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!