What is the problem in below code??
1 次查看(过去 30 天)
显示 更早的评论
I write a matlab code
x=[1 2 3 4 5 6 7 8];
n=length(x);
fs=100;
ts=1/fs;
tmax=(n-1)*ts;
t=0:ts:tmax;
plot(t,x)
f=-fs/2:fs/(n-1):fs/2;
z=fftshift(fft(x));
plot(f,abs(z));
and i got a error
??? Attempt to call constructor cell with incorrect letter case.
Error in ==> fftshift at 33
idx = cell(1, numDims);
Error in ==> Untitled at 9
z=fftshift(fft(x));
How can i solve it?
0 个评论
采纳的回答
Walter Roberson
2016-4-18
You probably have created a file named Cell.m with uppercase C; that is interfering with use of cell()
0 个评论
更多回答(1 个)
John D'Errico
2016-4-18
It runs for me, so apparently you are running different code there, probably on a different variable x, than what you have told us.
Check the variable x. What is it? LOOK AT THE CONTENTS OF x.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!