[問題] matlab的問題已回收
※ [本文轉錄自 Electronics 看板]
作者: asdwqq (活著就要動) 看板: Electronics
標題: [問題] matlab的問題
時間: Wed Jul 15 16:42:20 2009
最近被老師叫去用matlab去運算一些有關於microphone array
而我在網路上找到了一個相關的程式碼,複製下來使用卻發現程式上有了問題
FS=10000;
deltaT = 1/FS;
t = 0:deltaT:1; %1 second of sound
n = length(t);
deltaF = 1/(n * deltaT);
freq = (0:deltaF:FS/2)';
f1 = 700; %base frequency in Hz
x1 = sin(2*pi*f1*t);
s1 = x1;
s1fft = fft(s1);
v = 345; %speed of sound in m/s
d = .05; %distance between microphones in m
%theta = 45; %angle of signal source from array center in degrees
l = 1; %distance of signal source from array center in m
for theta = 1:360
for i=1:length(t)
x = l*cosd(theta);
y = l*sind(theta);
關鍵問題在於for,不知道為什麼我寫到這邊跑去運算一直跑出 for i=1:length(t)
這句有錯,At least one END is missing: the statement may begin here
不太了解,希望有人可以幫忙解惑。
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.124.32.118
→
07/15 17:20,
07/15 17:20
→
07/15 17:58,
07/15 17:58
→
07/15 19:29,
07/15 19:29
→
07/15 19:58,
07/15 19:58
→
07/15 22:32,
07/15 22:32
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.124.32.118
推
07/16 12:11, , 1F
07/16 12:11, 1F
推
07/16 13:23, , 2F
07/16 13:23, 2F
推
07/16 15:40, , 3F
07/16 15:40, 3F
→
07/16 15:40, , 4F
07/16 15:40, 4F
→
07/16 16:19, , 5F
07/16 16:19, 5F
討論串 (同標題文章)