Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.3K Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

Create a table / an array with conditions?

Posted 8 years ago

Hello everyone,

I'm trying (and failing) to create an array with dimensions {i1,j1,k1,i2,j2,k2}, conditioned to: {i1 + j1 + k1 = n} & {i2 + j2 + k2 = n}, where n is a fixed (given) integer number. In attachment is what I've done so far. Thank you very much!

Attachments:
POSTED BY: Daniel Grun
3 Replies

You can just create a function with inputs i1, j1, k1, i2 , j2, k2 and n to do what you want.

H[n_][i1_, j1_, k1_, i2_, j2_, k2_ ] := If [  i1 + j1 +k1 = n  && i2 + j2  +k2, (* Do something *), (* Do something *)]

You can even parametrize the tasks of the conditional statement in the above code.

POSTED BY: Ta'a Nwa Dombou
Posted 8 years ago

Actually, that's not what I was looking for - which I've already figured out. Thank you, anyway!

POSTED BY: Daniel Grun
Attachments:
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard