Good Day Everybody, I m new to maple and would like to translate the following for loop from Matlab to Maple. The FromMatlab Translater didnt work for this expression related to the matrix Q, A, B D and A1. Any help would be greatly appreciated.

Related Matlab Code:

...

Q(3,3)=2*Q(3,3);

for i=1:length(R)

T(1,1)=cos(R(i))^2;

T(2,2)=cos(R(i))^2;

T(1,2)=sin(R(i))^2;

T(2,1)=sin(R(i))^2;

T(3,1)=-sin(R(i))*cos(R(i));

T(3,2)=sin(R(i))*cos(R(i));

T(1,3)=2*sin(R(i))*cos(R(i));

T(2,3)=-2*sin(R(i))*cos(R(i));

T(3,3)=cos(R(i))^2-sin(R(i))^2;

T1(1,1)=cos(R(i));

T1(1,2)=-sin(R(i));

T1(2,1)=sin(R(i));

T1(2,2)=cos(R(i));

Qk(:,:,i)=inv(T)*Q*T;

Qk(:,3,i)=Qk(:,3,i)/2;

Qk1(:,:,i)=inv(T1)*Q1*T1;

A=A+Qk(:,:,i)*(h(i+1)-h(i));

B=B+.5*Qk(:,:,i)*(h(i+1)^2-h(i)^2);

D=D+1/3*Qk(:,:,i)*(h(i+1)^3-h(i)^3);

A1=A1+Qk1(:,:,i)*(h(i+1)-h(i));

end

Thanks a lot in advance.