Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
nned of better option and result

Subject: nned of better option and result

From: nethaji anandhavalli

Date: 10 Apr, 2010 08:49:05

Message: 1 of 1

hi,

for the derivation

enenrgy= summation of ( modulus of d(i)(j))^2 ) i= 1........L and j=1.......N which one would be correct in matlab?


set 1:

energy1=0
for i=i:N-1
for j=1:L-1
temp1=d(i)
temp2=d(j)
temp3=temp1 * temp2;
energy1=energy1+ (temp3*temp3)
end
end

note: this program would provide the energy for each coefficients values, am i right?

set 2:

double d[L][N]
double enenrgy=0
for i=i:N-1
for j=1:L-1
enenrgy+=d[i][j]^2
end
end

set 3:

double energy=0
for i=i:N-1
for j=1:L-1
enenrgy=(i%j)*(i%j);
energy+=energy;
end
end



pls sir. tell me which one would provide the better result? which get suit for above derivation in matlab.


--
with regards,
Nethaji anandhavalli . D

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us