I have a data set which is very large, thousands of rows and hundreds of column. I try to alternately reshape the data for every nth row, and all the nth row column data. I tried like this:
in=rand(71760,320);
m=240; n=320;
[R,C]=size(in);
out=[];
R_out=R/m;
for k=1:m %from row 1 to mth row
for i=1:C %reshape every column of mth row
out=[out;reshape(in(k:m:end,i),R_out,1)'];
end
end
If you try out the code, it took very long time and not efficient at all, you won't even bother to let it finish. How to increase the performance? Or there are better way to do it?
UPDATE
This question was extended to another thread here so as to improve the performance of reshaping answer provided by @Teddy