From: Chris on
I have a matrix of mean diameters of size 15X26. The rows are defined by longitude and columns by latitude. How do I create 3 vectors lat, lon, and diameter from this matrix? Thanks
From: us on
"Chris " <chris.veinot(a)hotmail.com> wrote in message <i1k9fk$au7$1(a)fred.mathworks.com>...
> I have a matrix of mean diameters of size 15X26. The rows are defined by longitude and columns by latitude. How do I create 3 vectors lat, lon, and diameter from this matrix? Thanks

one of the solutions

m=ceil(10*rand(2,3));
[ir,ic,iv]=find(m);
r=[ir,ic,iv];
disp(r);
%{
ROW# COL# VAL
1 1 6
2 1 3
1 2 4
2 2 9
1 3 10
2 3 5
%{
% now, replace linear indices IR/IC with the respective LON/LAT vals...

us
From: us on
"us "

there are two typos in the previous reply...
sorry for confusion...

one of the solutions

m=ceil(10*rand(2,3));
[ir,ic,iv]=find(m);
r=[ir,ic,iv];
disp(r);
%{
ROW# COL# VAL
1 1 6
2 1 3
1 2 4
2 2 9
1 3 10
2 3 5
%} % <- #1
% now, replace subscripts IR/IC with the respective LON/LAT vals... % <- #2

us