Extract a range of frequencies from a vector/array

Hello,
I hope you are in good health.
I am trying to select a range of frequencies from the given data set.
load phaseNoise.mat
plot(fnew,pnew)
new_value_from_fnew = fnew(fnew = 10e+009 | fnew <= 30e+009);
Unable to use a value of type string as an index.
However, I get an error when I try to set the initial and final value saying that 'Unable to use a value of type string as an index.'. I have tried changing the data type as well but didn't work either.
Basically, I want to only select the frequencies from 10GHz to 30GHz and discard the rest of the values so I can display the graph from 10GHz to 30GHz and perform further analysis on the given range only.
Any help will be appreciated.
BR.

 채택된 답변

KSSV
KSSV 2022년 9월 27일
new_value_from_fnew = fnew(fnew == 10e+009 | fnew > 30e+009); % <--- replace = with ==

댓글 수: 1

@KSSV wow ...
Thank you.
Can I also ask how to access the Y values for the given range?

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2022년 9월 27일

편집:

2022년 9월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by