How can we transpose a row vector into column vector in a cell

조회 수: 7 (최근 30일)
I want to convert a row vector in my defined cell into coulumn vector
A{1} = [1 2 3 4];
A{2} = [5 6 7 8];
I want to convert them into
A{1}=[1;2;3;4];
A{2}=[5;6;7;8];
Can this be done with a simple function

채택된 답변

madhan ravi
madhan ravi 2019년 8월 22일
cellfun(@(x) x(:),A,'un',0)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by