MATLAB: Multiply two matrix of quaterions

MATLABmatrixmultiplicationquaterion

hello how we can multiply 2 matrix of quaterions
exemple
C = {[1 2 3 4 ] [5 6 7 8 ] ; * {[1 2 3 4 ] [5 6 7 8 ] ;
[8 9 10 11 ] [12 13 14 15 ] } [8 9 10 11 ] [12 13 14 15 ] }
i had realised a function who multiply 2 matrix of quaterions
function a = matrice_multiplication(A, B)
[r1 , c1] = size(A);
[r2 , c2] = size(B);
% % prevent unappropriate matrix size
if c1 ~= r2
disp ('*** not able to multiply matrices ***')
end
for i = 1 : r1
% Vary each column of matrix B
for j = 1 : c2
% Reset every new element of the final result
% c=cell (r1 , c2)
s = [0,0,0,0]
% Vary each column of matrix A and row of matrix B
for k = 1 : c1
% Display every element to take into account
% disp( A{i,k})
% disp ( B{k,j})
s =plus(s, quatmultiply(A{i,k},B{k,j}))
%
end
% % Assign the total of the appropriate element
% % to the final matrix
c{i,j} = s
% disp ( c{1,1})
% disp ( c{1,2})
% disp ( c{2,1})
% disp ( c{2,2})
a{i,j} = c{i,j}
% disp (a{i,j})
end
end
end
when i test this function the result is f = matrice_multplication (a,b) the result is s =
0 0 0 0
s =
-28 4 6 8
s =
-216 104 132 136
c =
[1x4 double]
a =
[1x4 double]
s =
0 0 0 0
s =
-60 12 30 24
s =
-312 152 212 200
c =
[1x4 double] [1x4 double]
a =
[1x4 double] [1x4 double]
s =
0 0 0 0
s =
-92 36 22 56
s =
-472 296 292 360
c =
[1x4 double] [1x4 double]
[1x4 double] []
a =
[1x4 double] [1x4 double]
[1x4 double] []
s =
0 0 0 0
s =
-188 108 110 136
s =
-696 472 500 552
c =
[1x4 double] [1x4 double]
[1x4 double] [1x4 double]
a =
[1x4 double] [1x4 double]
[1x4 double] [1x4 double]
f =
[1x4 double] [1x4 double]
[1x4 double] [1x4 double]
so i have a problem of display i need to my function diplay just f without displaying c s a ….

Best Answer

Suppress output by adding a semicolon to the end of each calculation. For example
c{i,j} = s;
instead of
c{i,j} = s