필터 지우기
필터 지우기

bandwidth at certain height

조회 수: 3 (최근 30일)
addy fang
addy fang 2020년 7월 13일
댓글: addy fang 2020년 7월 21일
I am new to Matlab and hope someone can help me out. I try to get the bandwidth at certain reading of a peak, and write the following code. But run into a few problems. The codes are follows.
%%%read in data%%%
origindata=importdata('rawdata.txt');
f=origindata(:,1);
a=origindata(:,2);
b=origindata(:,3);
c=origindata(:,4);
d=origindata(:,5);
%%%start count y%%%
y=0;
%%%start loop t for calculation%%%%
for t=(0.1:0.1:20)
e=a-j*b;
u=c-j*d;
rl=u.*e.*f*t;
%%%save results%%%
y=y+1;
y1(:,3*y-2)=f;
y1(:,3*y-1)=rl;
y1(:,3*y)=t;
%%%calculate peak width%%%
RLmax=min(rl);
w1=f(f(abs(rl+10)<0.1)<f(rl==RLmax));
w2=f(f(abs(rl+10)<0.1)>f(rl==RLmax));
width=w2-w1;
%%%save peak width in z1%%%
z1(y,1)=t;
z1(y,2)=f(rl==RLmax);
z1(y,3)=RLmax;
z1(y,4)=w1;
z1(y,5)=w2;
z1(y,6)=width;
hold on;
end;
xlswrite('y1',y1);
xlswrite('z1',z1);
I got this:
"Unable to perform assignment because the size of the left side is 1-by-1 and the size of the
right side is 0-by-1."
It seemed the following codes caused problem, as I removed them and related, it ran ok.
w1=f(f(abs(rl+10)<0.1)<f(rl==RLmax));
w2=f(f(abs(rl+10)<0.1)>f(rl==RLmax));
width=w2-w1;
But I need to extract those information. Can anyone help me out? Thank you.
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 7월 17일
more than one entry can equal the min.
It is not obvious that any entries will meet the abs() compared to f() test.
That section of code is too complicated for other people to to be expected to understand. Break it up into separate lines with comments.
addy fang
addy fang 2020년 7월 21일
Ok. Thank you.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by