explain this code if it is correct or not

Thread Starter

sathya666

Joined Nov 10, 2012
1
x=wavread('E:\project\kani imp\akk');
l=size(x)
s=1;
t2=1;
%ensegment=0;
for t=[4000:4000:l]
sum=0;
for t1=[s:t]
%sum=sum+(abs(x.^2));
s=sum+abs(x(t1)^2);
en(t2)=s;
end
%en(t2)=sum;
s=s+4000;
t2=t2+1;
%plot(en);
%ensegment=ensegment+1;
end
l1=size(en);
m1 = max(en);
for (i = 1:l1)
if en(i)== m1
break
end
end
sm = i;
%st = (max*4000)- 2000;
%end = st + 4000;
%yx = st:end
%plot(x(yx))
%stem(y,en)
 

WBahn

Joined Mar 31, 2012
30,077
Since the only thing we have to go on is what you are telling it to do, then, yes, it is correct. It is doing exactly what you told it to do.
 

spinnaker

Joined Oct 29, 2009
7,830
It is beyond me how someone that is smart enough to learn to program is not smart enough to provide enough information so others can help them with a question.
 
Top