help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing submatrices of a multidimensional matrix


From: oxy
Subject: printing submatrices of a multidimensional matrix
Date: Wed, 22 Jan 2014 12:57:24 +0100

Hi Guys,

I'd like to print two-dimensional (N vs N) submatrices
of a multidimensional matrix (N vs N vs N vs N).

I need it in order to plot these submatrices with mesh.

It works for some combinations of dimensions,
for example matrix(:, :, 1, 1) will give you a submatrix
and i can mesh-plot it. However matrix(1, 1, :, :) will
give me a set of vectors, which i cannot use as input
to mesh.

I'd like to get some advice from you of how to overcome it.
I need to plot all possible submatrices. See an example bellow:

%===== start code =======
clf;
dim=11;
for a=(1:dim)
    for b=(1:dim)
        for c=(1:dim)
            for d=(1:dim)
                sig(a,b,c,d) = a*b*c*d;
            endfor
        endfor
    endfor
endfor

mesh(1:dim,1:dim,sig(:,:,1,1))   % this works
mesh(1:dim,1:dim,sig(1,1,:,:))   % this wont work
%===== end code =======

I appreciate very much your help!
Best...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]