Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3355 > unrolled thread
| Started by | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| First post | 2011-06-29 21:30 +0000 |
| Last post | 2011-06-29 21:30 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Table with conditions Heike Gramberg <heike.gramberg@gmail.com> - 2011-06-29 21:30 +0000
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Date | 2011-06-29 21:30 +0000 |
| Subject | Re: Table with conditions |
| Message-ID | <iug5h7$9eq$1@smc.vnet.net> |
For each k you want -hi<=l<=hi, and -h-k<=l<=h-k. This can be combined to Max[-hi,-h-k]<=l<=Min[hi,h-k]].
You could therefore write P1 according to
P1 = Flatten[
Table[{Pk[k].Fl[l], k + l}, {k, -h, h}, {l, Max[-hi, -h - k],
Min[hi, h - k]}], 1]
Heike.
On 26 Jun 2011, at 11:25, J. Jesus Rico Melgoza wrote:
> I am constructing a Table
>
> h=60
> hi=60
> P1 = Flatten[
> Table[{Pk[k].Fl[l], k + l}, {k, -h,
> h}, {l, -hi, hi}], 1]
> This yields a table with two columns. First column contains vector of order n and column 2 contains an scalar
> I want to add conditions to generate the elements in the Table
> -h<=k+l<=h.
> I do not know how to do this with the function Table[..] of Mathematica. I am asking for your help.
> I do not want rows in my table that do not satisfy the condition.
>
> Pk[k] is matrix and Fl[l] is a column vector
>
> Thanks in advance
>
> Jesus Rico-Melgoza
>
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web