One large array from multiple arrays Matlab -
i'v multiple arrays of [1x3]
, named them array1
array2
array3
, on. want create 1 array arrays such array=array1(i,1:3)
array=array2(i,4:6)
, on. how can done looping or suggestions regarding approach, want access multiple arrays dynamic i'm going approach, other suggestions welcomed thought there slow computations , processing speed when array size increases.
my code:
i=1:10 array(i)=array(:,i:i+3); end
the easiest way use cat
function:
array = cat(2,array_1,array_2,array_3);
if want access array_i (i=1,2,3,...)
array_i = array((i-1)*3+1:i*3);
the j
th index (j=1,2,3) of array_i
(i=1,2,3,4,...) can accessed:
jth_index_of_array_i = array((i-1)*3+j)
Comments
Post a Comment