Hi all,
Just as the topic says, I've got a N-dimension matrix (N is unknown),
and I would like, based on this to select some subsets of this matrix;
the code would be more or less like this:
size = l;
N = k;
mat = zeros([ones(1,N)*size]);
dim_size=[ones(1,N)*size];
%Now let's say I would like to have the submatrix
mat(1,2,:,:,:,6,7,8);
% I can't use a sequence of nested for I should assume to know N
% I thoght to run something like
coord = [1,2,0,0,0,6,7,8];
for i=1:1:N
mat = mat(coord(i), :);
end
This anyway doesn't work as the useage of only "mat(coord(i), :)"
instead of "mat(coord(i), :,:,:,:,:,:,:)" modify the matrix outcome;
on the contrary I can't use "mat(coord(i), :,:,:,:,:,:,:)" because in
the second round I should remove the last ":" ...
I hope you got the issue..
Thanks in advance,
RM
|
|
0
|
|
|
|
Reply
|
inuY4sha1 (12)
|
3/28/2008 12:21:16 PM |
|
Try the following:
coord = {1, 2, ':', ':', ':', 6, 7, 8};
mat(coord{:}) % to see the data
% or
squeeze(mat(coord{:})) % to get the data out as another matrix
"InuY4sha" <inuY4sha@email.it> wrote in message
news:926b07e1-ea29-4b48-b568-ab80b71a09b6@b1g2000hsg.googlegroups.com...
> Hi all,
> Just as the topic says, I've got a N-dimension matrix (N is unknown),
> and I would like, based on this to select some subsets of this matrix;
> the code would be more or less like this:
>
> size = l;
> N = k;
> mat = zeros([ones(1,N)*size]);
> dim_size=[ones(1,N)*size];
>
> %Now let's say I would like to have the submatrix
> mat(1,2,:,:,:,6,7,8);
> % I can't use a sequence of nested for I should assume to know N
> % I thoght to run something like
> coord = [1,2,0,0,0,6,7,8];
> for i=1:1:N
> mat = mat(coord(i), :);
> end
>
> This anyway doesn't work as the useage of only "mat(coord(i), :)"
> instead of "mat(coord(i), :,:,:,:,:,:,:)" modify the matrix outcome;
> on the contrary I can't use "mat(coord(i), :,:,:,:,:,:,:)" because in
> the second round I should remove the last ":" ...
> I hope you got the issue..
>
> Thanks in advance,
> RM
|
|
0
|
|
|
|
Reply
|
dlad (42)
|
3/28/2008 1:12:16 PM
|
|
|
1 Replies
29 Views
(page loaded in 0.057 seconds)
Similiar Articles: write multidimensional matrix to text file - comp.soft-sys.matlab ...If a dimension of the multi-dimensional matrix takes this form: C(:,:,1) 0 3 0 7 0 6 2 9 0 0 1 ... Selecting elements of a multidimensional matrix - comp.soft-sys ... plot of fft2 of M x N - comp.soft-sys.matlab----- m = size(AF); M = 4; N=2*M-1; %zero ... randomPoints = []; for i=1:2 index ... rows? - comp.databases.mysql selecting ... Y = fft2(X) returns the two-dimensional ... Re: Finding local maxima in multidimensional array (efficiently ...... And@@LessEqual@@@Transpose@{{1,1,1,1},#,dims}&)]]; >> Select[Position ... In[25]:= n=40; data=RandomReal[1,{n,n,n,n ... such things (it doesn't have proper multi-dimensional ... Unable to access the elements in an array with array[1][0] - comp ...I have what I believe to be a 2 dimensional array, but I can not access the elements in the array with the array syntax array[1][0] when I select the first element in ... Paste 2D array into excel via activex - comp.soft-sys.matlab ...... com/support/solutions/e= n/data/1-17PWC ... MATLAB array into Excel > A =3D [1 2; 3 4]; > %select ... array. - comp.lang.ada ..... two dimensional array of ... array into one ... namelist input of multidimensional array? - comp.lang.fortran ...I can load a 1-D array (a vector) easily enough ... Selecting elements of a multidimensional matrix - comp ... Reading a two-dimensional array in namelist, f90 Programming ... duplicate records data into single row - comp.soft-sys.sas ...select multiple rows as one row - comp.databases.mysql duplicate ... data x; input subject sx : $1.; datalines; 1 N ... Copying rows in a two dimensional array. - comp.lang ... plotting two dimension grid array - comp.lang.idl-pvwave ...As above, I think SURFACE, CONTOUR or TV will be your friends, choosing between ... 2D double array in Mex - comp.soft-sys.matlab ... Copying rows in a two dimensional ... Intel Visual Fortran Error Message - comp.lang.fortranHelp needed: read 3-dimensional array from a MAT-file in Fortran ... I am, a ... with compiler - comp ..... to locate installed compilers [y]/n? y Select a compiler: [1 ... Re: Sample of a bivariate Probability Density Estimation data ...PROC SURVEYSELECT is then employed to select a random sample of N=248 observations from the ... for bivariate data... ks for kernel density estimation for 2-dimensional data. Matlab: Selecting data from a matrix based on user input ...Selecting a submatrix from a N-dimensional one; Hi all,Just as the topic says, I've got a N-dimension matrix (N is unknown),and I would like, based on this to select some ... Matlab/Octave Tutorial - Ismail-Beigi Group - - Welcome!Making a two-dimensional plot; Getting some grid ... being x2 (so the spacing is (x2-x1)/(n-1)). Selecting ... M(2:5,1:3) % a 4 x 3 submatrix of M M(:,4) % 4th ... 7/22/2012 10:49:00 AM
|