Changing format/size of matrix in table
Show older comments
I have a 1071x1 matrix right now, the values are distances from a specific point to every coordinates in a 20x50 floor plan
How can i turn the 1071x1 table into a 21x51 ones?
I have tried to make them into different rows then combining them but............
compwidth=50;
compdepth=20;
Xo = 25;
Yo = 10;
Origin=[Xo, Yo];
x = 0:compwidth;
y = 0:compdepth;
[X,Y] = ndgrid(x,y);
XY = [X(:), Y(:)];
%disp(XY);
AB=[((X(:)-Xo).^2 + (Y(:)-Yo).^2).^0.5];
for i=1:(compdepth+1)
Row(i)= AB((i+(i-1)*compwidth):(compwidth*i+1))';
i=i+1;
end
Accepted Answer
More Answers (0)
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!