How can I write a small loop to create many similar matrices with different names like mat1, mat2, mat3, etc?
I have to declare and fill many matrices but should not do it one by one.
Is there a "do" loop structure that can be used?
Thank you
Code requires creating many matrices
-
TomDoan
- Posts: 7825
- Joined: Wed Nov 01, 2006 4:36 pm
Re: Code requires creating many matrices
The best way to handle that is almost certainly to use a VECT[RECT] structure, likejesusgonzalez wrote:How can I write a small loop to create many similar matrices with different names like mat1, mat2, mat3, etc?
I have to declare and fill many matrices but should not do it one by one.
Is there a "do" loop structure that can be used?
Thank you
dec vect[rect] mat(100)
which will create 100 matrices which you would references as mat(1), ..., mat(100).