This code is not wroking I want to create a for loop to perform FFT
M = 1:100
dt =.1
time = 0:0.5:(length(M)-1)/2
samplerate=1/dt;
J= length(S)/samplerate-dt
t = 0:1/samplerate:(J) %0:1/200:length(time)-1;
L = length(t)
f = samplerate*(0:(L/2))/L;
dat1 = f(1,:).';
for i = 1:10
MM(:,i) = FLOW(:,i)
y(:,i) = fft(MM(:,i))%fft(FLOW(:,i))
P20 = abs(y(:,i)/L)
P10(:,i)= P20((:,i)(1:L/2+1)))
P10(2:end-1) = 2*P10(2:end-1)
A = ( P10(:,i));
dat1 =[dat1,A];
end

댓글 수: 4

KSSV
KSSV 2020년 2월 13일
This code is not wroking
Why? what is the error/ problem?
Joshua David Selvaraj
Joshua David Selvaraj 2020년 2월 13일
P10= P20(1:L/2+1)
using this makes the code work but the problem is i need to keep the counter (i) to get continued so that I can save them in dat1
Siriniharika Katukam
Siriniharika Katukam 2020년 2월 17일
What is "S" in line 5 and "FLOW" in first line of for loop?
JoshuaDavid Selvaraj
JoshuaDavid Selvaraj 2020년 2월 17일
P10= P20(1:L/2+1,:) this works i fixied it however thans for your support

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

제품

질문:

2020년 2월 13일

댓글:

2020년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by