I think it might be right. Just discovered that the function line has to be the top line of code otherwise it doesn't work.
Function definitions are not permitted.... trying to make an FFT thing
2 次查看(过去 30 天)
显示 更早的评论
Function definitions are not permitted.... trying to make an FFT thing
I'm trying to get this working
close all
clear all
function[X,freq]=positiveFFT(x,Fs);
N=length(x);
k=0:N-1;
T=N/Fs;
freq=k/T;
X=fft(x)/N;
cutOff = ceil(N/2);
X = X(1/cutOff);
freq = freq(1:cutOff);
Any ideas?
0 个评论
采纳的回答
更多回答(2 个)
Walter Roberson
2012-1-26
You should think of "clear all" as being like trying to reprogram the fuel injector computer on a car: if you don't have years and years of training, you probably should not even be considering doing it.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Software Development Tools 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!