Message Boards Message Boards

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

Iteration of a Matrix

Posted 5 years ago

I want to update "matrix1" 100 times. "matrix3" will be new "matrix1" and it will iterate 100 times. Should I use a loop or function? First iteration is:

matrix1 = ( {
    {1, 2, 3},
    {4, 5, 6},
    {7, 8, 9}
   } );
matrix2 = matrix1*2 - 1;
matrix3 = matrix2 + 5;
matrix3

Output (First iteration):

{{6, 8, 10}, {12, 14, 16}, {18, 20, 22}}

matrix3 will be new matrix1

matrix1 = ( {
    {6, 8, 10},
    {12, 14, 16},
    {18, 20, 22}
   } );
matrix2 = matrix1*2 - 1;
matrix3 = matrix2 + 5;
matrix3

Output (Second iteration):

{{16, 20, 24}, {28, 32, 36}, {40, 44, 48}}
POSTED BY: Nagon Stewart
2 Replies

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

Please next time link your post to the duplicated one from MSE site.

POSTED BY: Moderation Team
Posted 5 years ago

Crossposted here. In the future, if you are crossposting, please add links so people do not waste time trying to answer a question that has already been answered. Thanks.

POSTED BY: Rohit Namjoshi
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