How can i write the frequency vector for frequency range 5-400 hz using 50 frequncy points

 채택된 답변

Hi Lisa, you cannot have 50 frequencies in 30 elements. Obviously whatever Q is here (is it a power spectral density estimate?) is an estimate at only 30 frequency points.
You can space your frequency vector to cover 5 to 400 Hz with fifty points and then select a subset of those 50 so that you can plot(f,Q)
freq = linspace(5,400,50);
% just making up some junk data to plot
Q = abs(randn(30,1));
plot(freq(1:30),Q)

추가 답변 (1개)

Ryan
Ryan 2012년 7월 13일
편집: Ryan 2012년 7월 13일
FrequencyVector = linspace(5,400,50); %linspace(min,max,# of points)

댓글 수: 2

f=linspace(5,400,50);
plot(f,Q)
it won't work
Q has a length of 30x1
and f has a length of 1x50
How can i make f 1x30 and still ranging from 5-400 and 50 frequency points
See Wayne King's answer. These type of details should be included in the original question to provide the best answer possible.

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

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by