Message Boards Message Boards

0
|
3730 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Iterating a replacement rule

Posted 9 years ago

So i have this :

T4 = Sort[c2 @@@ Flatten[Table[{gl, wl, x, t}, {gl, 60, 90, 1}, {wl, 25, 45, 1}] /. {x -> 0, t -> 4}, 1]][[1]]

I want to T4[x_] to give me a list that iterate x over 0 ,1 ,2 ,3,...,x ,also the table can probably be done without needing to flatten it.

POSTED BY: Fred Alstair
2 Replies
Posted 9 years ago

Yes I tried it but I was getting protected tag error, probably from being in In[1000]:= range, restarted mathematica and it worked.

POSTED BY: Fred Alstair

Is this what your are looking for?

In[3]:= t4[xx_] := 
 Sort[c2 @@@ 
    Flatten[Table[{gl, wl, x, t}, {gl, 60, 90, 1}, {wl, 25, 45, 
        1}] /. {x -> xx, t -> 4}, 1]][[1]]

In[4]:= t4[0]

Out[4]= c2[60, 25, 0, 4]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract