Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3356

Re: Table with conditions

From Bob Hanlon <hanlonr@cox.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Table with conditions
Date 2011-06-29 21:30 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iug5i5$9et$1@smc.vnet.net> (permalink)

Show all headers | View raw


Reduce[{-h <= k + 1 <= h, -h <= k <= h}, k]

(h == 1/2 && k == -(1/2)) || (h > 1/2 && -h <= k <= -1 + h)

%[[-1, -1]]

-h <= k <= -1 + h

In the Table, the iterator for k should be {k, -h, h-1}


Bob Hanlon

---- "J. Jesus Rico Melgoza" <jerico@umich.mx> 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 comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Table with conditions Bob Hanlon <hanlonr@cox.net> - 2011-06-29 21:30 +0000

csiph-web