Log graphic and matrix problem

1 Ansicht (letzte 30 Tage)
Adrian Grzesik
Adrian Grzesik am 19 Nov. 2019
Bearbeitet: KALYAN ACHARJYA am 19 Nov. 2019
hi, i got issue with my code, i want to display function on graph with semilogx but i got "matrix error":
Error using ^ (line 51)
Incorrect dimensions for raising a matrix to a
power. Check that the matrix is square and the
power is a scalar. To perform elementwise matrix
powers, use '.^'.
Error in Grzesik_cz3/plot_g (line 13)
y=20*log(abs((1/(R1*R2*C1*C2))/(((1j*2*pi*x)^2)+((1j*2*pi*x)*((1/(R1*C1))+(1/(R2*C1))+(1/(R2*C2))))+(1/(R1*R2*C1*C2)))));
Error in Grzesik_cz3 (line 9)
plot_g(C1,R1,C2,R2)
thisis my code:
function Grzesik_cz3
%deklaracje
C1=0.000000032;%F%
C2=0.000000032;%F%
R1=1000;%Ohm%
R2=1000;%Ohm%
plot_g(C1,R1,C2,R2)
function plot_g(C1,R1,C2,R2)
x=0.001:1000000;
y=20*log(abs((1/(R1*R2*C1*C2))/(((1j*2*pi*x)^2)+((1j*2*pi*x)*((1/(R1*C1))+(1/(R2*C1))+(1/(R2*C2))))+(1/(R1*R2*C1*C2)))));
figure
semilogx(x,y);
hold off
end
end

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 19 Nov. 2019
Bearbeitet: KALYAN ACHARJYA am 19 Nov. 2019
Try with (element wise operation)
.^

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by