Aller au contenu

Mathc matrices/02a

Un livre de Wikilivres.


Utilitaire


Afficher trois matrices sous forme de trois images couleur indexée

Display a matrix as an indexed color image with octave
Copy/Paste into the octave window
% imagesc(A):
%
% Display a matrix as an indexed color image.

% Matrix 2x2 -------------

A = [3 4;
     4 2]

figure(1)
imagesc(A)        % Display a matrix as an indexed color image
axis square,  title('A')
%%


% Matrix 3x3 ---------------------

B = [ 1  3 5 ;
      3  2 4 ;
      5 4  3 ]

figure(2)
imagesc(B)         % Display a matrix as an indexed color image
axis square,title('B')
%%


% Matrix 3x2 ---------------------

C = [ 1  3 ;
      3  2 ;
      5 4  ]

figure(3)
imagesc(C)          % Display a matrix as an indexed color image
axis square,title('C')
%%