Why do I get the error message 'Inner matrix dimensions must agree?
Show older comments
hello.. can someone help me?
Answers (1)
Read about MATLAB element by element operations. YOu cannot multiply two same vectors using *, you need to multiply element by element, so use . *
%%MBVD
ws=6.37e10;
wp=6.55e10;
qso=1.80e27;
qpo=1.75e27;
Xp=62.06;
f=8e9:5e6:10e9;
w=2*pi*f;
co=w./ws;
c1=w./wp;
d_o=1./qso;
d_1=1./qpo;
do=co*d_o;
d1=c1*d_1;
d2=1-co.^2+1i*do;
d3=1-c1.^2+1i*d1;
op_amp1=Xp*d2;
op_amp2=1i*c1.*d3;
Z_in=op_amp1./op_amp2;
Zin_real=abs(Z_in);
Zin_imag=imag(Z_in);
Zin_phase=-(180/3.142)*atan(Zin_real);
semilogy(f,Zin_real);
%semilogy(f, Zin_real, 'ko', 'MarkerSize', 2)
ylabel('|Z|(Ohm)');
xlabel('Frequency(Hz)');
grid
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!