Function's Specgram

12 次查看(过去 30 天)
Batuhan Istanbullu
Hi, i have a function code in MATLAB and i want to plot the specgram of that function but could not find the right code of it
i used;
figure, specgram(getFilter), colorbar
but it gave me an error
Any Help ?

回答(1 个)

Cris LaPierre
Cris LaPierre 2021-1-8
编辑:Cris LaPierre 2021-1-8
What error are you getting? Undefined function or variable 'specgram'.?
There is no specgram in the current version of MATLAB. What version are you using? Perhaps try using spectrogram, which replaced specgram around 2005.
  2 个评论
Batuhan Istanbullu
function Hd = getFilter
figure, specgram(getFilter), colorbar
end
in the function there are some filtering codes, when write this it gives me an error like;
Function definitions in a script must appear at the end of the file.
Move all statements after the "getFilter" function definition to before the first local function definition.
I am using latest version of matlab, but I want to take a specgram of the function how can i do that
Cris LaPierre
Cris LaPierre 2021-1-8
My suggestions
  1. You have apparently defined your function in the wrong place. Follow what the message says. If you need more help, see the Create Function in Files documentation page
  2. About specgram, see my first reply.

请先登录,再进行评论。

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by