indexing matrices
I'm not very experienced in programming and kind of stuck right now.
I am trying to implement the following loop on matrix calculations.
All matrices are 3x3
//R[0]= intial condition matrix
//I =identity matrix
//B= matrix
//k1,k2 = scalars
For (i=1;i<100;i+=1)
//calculate k1,k2
// calculate B
R[i]=R[i -1] x ( I + k1*B + k2*B^2)
///do some calculations using R[i]
// delete R[i-1]
endfor
Could somebody help?
July 4, 2016 at 09:52 pm - Permalink
If matB is not specified initially and matB will not be used in other procedure,
July 4, 2016 at 10:22 pm - Permalink
dear SJR51,
Thank for trying to help. The above is not an extent of my code, but more a sketch of want I want to accomplish. I know how to do the declarations, and I understand the matrix indexing. Basically, I believe my struggle resumes to this:
1. how to index a matrix as a whole inside a loop.
2. Matrixop does not seem to handle indexing. how can I use indexing inside a Matrixop operation?
Thanks
July 4, 2016 at 11:23 pm - Permalink
Dear Kanekaka
That solved my problem!
I thought I couldn't use the destination matrix on both sides of the argument of Matrixop, but this is only the case for 3d waves.
Thank you!
July 5, 2016 at 12:20 am - Permalink