Log graphic and matrix problem

조회 수: 1 (최근 30일)
Adrian Grzesik
Adrian Grzesik 2019년 11월 19일
편집: KALYAN ACHARJYA 2019년 11월 19일
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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 11월 19일
편집: KALYAN ACHARJYA 2019년 11월 19일
Try with (element wise operation)
.^

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by