Question: Assign matix row to variables

Hi, in the 'assign' command below, a certain row from matrix 'R' is assigned to the variables RA, MA .. yB. The command works well. However, I wonder if it could not be better/ shorter. So, without having to write out R [1], R [2] .. R [8].

I would be very happy if someone could advise me on this.

Here is the algorithm:

restart:with(linalg):
R:=Matrix(2,8,[1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18]);


aFshear:=proc(nr,R)
assign(('RA','MA','thetaA','yA','RB','MB','thetaB','yB')
= (R[1],R[2],R[3],R[4],R[5],R[6],R[7],R[8]));
end:


aFshear(2,row(R,2));
print(thetaB);

 

 

Please Wait...