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:
i need this in c language

Subject: i need this in c language

From: nethaji anandhavalli

Date: 9 Apr, 2010 13:59:05

Message: 1 of 8

energy = summation of (modulus of d(ij) )^2 where i= 1...l and j= 1....N
pls guide me pls pls pls

Subject: i need this in c language

From: dpb

Date: 9 Apr, 2010 14:03:39

Message: 2 of 8

nethaji anandhavalli wrote:
> energy = summation of (modulus of d(ij) )^2 where i= 1...l and j= 1....N

So you come to a Matlab forum for C...right.

--

Subject: i need this in c language

From: Dave Robinson

Date: 9 Apr, 2010 14:07:07

Message: 3 of 8

"nethaji anandhavalli" <mydreamprojects@yahoo.com> wrote in message <hpnbr9$j3e$1@fred.mathworks.com>...
> energy = summation of (modulus of d(ij) )^2 where i= 1...l and j= 1....N
> pls guide me pls pls pls

If you want it in C then go to a C language forum, don't pester us here, we deal in Matlab

Regards

Dave Robinson

Subject: i need this in c language

From: nethaji anandhavalli

Date: 9 Apr, 2010 14:43:25

Message: 4 of 8

sorry

Subject: i need this in c language

From: Walter Roberson

Date: 9 Apr, 2010 15:30:01

Message: 5 of 8

nethaji anandhavalli wrote:
> energy = summation of (modulus of d(ij) )^2 where i= 1...l and j= 1....N
> pls guide me pls pls pls

Try comp.lang.c for C questions.
http://groups.google.com/groups/search?q=group:comp.lang.c&scoring=d

Note: in comp.lang.c, they are likely to point out that "modulus" in C
has to do with remainder with respect to division by a certain number,
such as 5 modulo 3 resulting in a modulus of 2. If that isn't the kind
of modulus you mean, then when you ask over in comp.lang.c you should
clarify what you _do_ mean. You should also make clear to them what your
data type is.

Also, isn't it kind of pointless for i to run from 1 to 1 ?

Subject: i need this in c language

From: Mark Shore

Date: 9 Apr, 2010 15:48:23

Message: 6 of 8

Walter Roberson <roberson@hushmail.com> wrote in message
>
> Also, isn't it kind of pointless for i to run from 1 to 1 ?

The second index is actually a lower-case "L". This particular example is not important, but I've noticed that when code samples are cut and pasted, uncommon fonts or characters can appear in unpredictable fashion on other readers' computers.

Subject: i need this in c language

From: nethaji anandhavalli

Date: 9 Apr, 2010 16:16:06

Message: 7 of 8

its a point of i= i....... L

Subject: need of better option and result

From: nethaji anandhavalli

Date: 10 Apr, 2010 08:52:05

Message: 8 of 8

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