hello everyone I wrote this code to read the indices of 3 dimensional matrix in a three column array. For n<100 (i.e. 100x100x100 matrix), MATLAB runs it in few hours. However, my final matrix is a 640x640x640 one for which MATLAB takes ages to finish. Could someone please help improve the code to run it faster. Any help is greatly appreciated.
clear all close all clc
n=640;
A = zeros(n,n,n);
Y = [0 0 0];
for i = 1:size(A(:, 1))
i for j = 1:size(A(:, 2)) for k = 1:size(A(:, 3)) Y = [Y;i,j,k]; end end
end
Best Answer