about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/KPMtools/myreshape.m
blob: 9613f1dc4451264c72ff28135ac62a9d7eb01647 (plain)
1
2
3
4
5
6
7
8
9
10
11
function T = myreshape(T, sizes)
% MYRESHAPE Like the built-in reshape, except myreshape(T,n) == reshape(T,[n 1])
% T = myreshape(T, sizes)

if length(sizes)==0
  return;
elseif length(sizes)==1
  T = reshape(T, [sizes 1]);
else
  T = reshape(T, sizes(:)');
end