MATLAB: How to simplify this code

indexingmatrixsimplificationvector

X16 = [X{3}',X{4}',X{5}',X{6}',X{7}',X{8}',X{9}',X{10}',X{11}',X{12}',X{13}',X{14}',X{15}',X{16}'];
% X32 = [X[3]' to X[32]'];
% X48 = [X{3}' to X[48}'];
% X64 = [X{3}' to X{64}'];
% X80 = [X{3}' to X{80}'];
% X96 = [X{3}' to X{96}'];
% X112 = [X{3}' to X{112}'];
% X128 = [X{3}' to X{128}'];
% X144 = [X{3}' to X{144}'];
% X160= [X{3}' to X{160}'];
Hi, lets say i have already defined my X{3} to X{160}, how do i define my X32, X48, X64, X80, X96, X112, X128, X144, and X160 without writing one by one?

Best Answer

X = 1:10 ;
X10 = zeros([],1) ;
for i = 3:10
X10 = [X10 X(i)] ;
end
The above can be simply achieved using:
X10 = X(3:10) ;