필터 지우기
필터 지우기

Hello I would to figure out how to add poles into matrix from a for loop

조회 수: 1 (최근 30일)
Trevon Alvarado
Trevon Alvarado 2020년 4월 30일
답변: Sai Sri Pathuri 2020년 5월 4일
I am designing a band pass filter and I need to take the roots of the low pass filter roots and store them. Can you please help me with this.
sp2 = roots(Gain_den);
sp = sp2(real(sp2)<0)
%sp=[1.0000 + 0.0000i -0.2471 - 0.9660i 1.0000 + 0.0000i]
for k = 1:N_Stages
poles=[1 sp(k) 1]
p1=roots(poles)
end
I had an idea coding it like this:
sp2 = roots(Gain_den);
sp = sp2(real(sp2)<0)
%sp=[1.0000 + 0.0000i -0.2471 - 0.9660i 1.0000 + 0.0000i]
for k = 1:N_Stages
poles(k)=[1 sp(k) 1]
p1=roots(poles(k))
end
I had gotten this error when attempting to do it this way.
Unable to perform assignment because the left and right sides have a different number
of elements.
  댓글 수: 1
darova
darova 2020년 4월 30일
You want to assign 3 values
It's impossible poles(k) has only 1 place ( for one value )

댓글을 달려면 로그인하십시오.

답변 (1개)

Sai Sri Pathuri
Sai Sri Pathuri 2020년 5월 4일
In the code,
poles(k)=[1 sp(k) 1]
you are assigning a row vector of size 1x3 to poles(k) with size 1x1. The error is due to mismatch between sizes.

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by