facing problem in plotting spectrogram.everytym an error occurs irrespective of the correct coding

i am unable to plot the spectrogram of a given signal.please help me.i am using the following codes.... t=0:0.001:2; y=chirp(t,0,1,150); spectogram(y,256,1e3,256,250,'y axis'); subplot(2,1,1); title('Quadratic Chirp');
pls help..

 채택된 답변

t=0:0.001:2;
subplot(2,1,1); title('Quadratic Chirp');
y=chirp(t,0,1,150);
spectrogram(y,256,250,256,250,'yaxis');
  1. spectrogram misspelled
  2. wrong use of the subplot, it's before not after doing the drawing
  3. bad parameters on the spectrogram function

댓글 수: 6

Error in ==> spectrogram1 at 4
spectrogram(y,256,250,256,250,'y axis');
dis is what i am getting again..:(
it's not 'y axis' but 'yaxis', notice the absence of the space on the string
it does not matter,its inside ' '
still d same error..
Error in ==> spectrogram1 at 4
spectrogram(y,256,250,256,250,'yaxis');
please post the entire error message. Paulo's code works fine.
thanx a ton..i worked..
btw this was the error..
??? Attempt to execute SCRIPT spectrogram as a function..
but now its working..thanx..:)
that's what you get when using the names of functions on scripts, bad idea, same goes for variables with same name of functions, bad idea!

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by