필터 지우기
필터 지우기

How to divide the column data into variable length?

조회 수: 2 (최근 30일)
kitty varghese
kitty varghese 2018년 11월 28일
편집: TADA 2018년 11월 28일
I have a column vector of size A=20. I want to divide this column vector into 5 smaller vector of size 5,4,3,6 and 2. Such that a1 is of size 5x1,a2 size=4x1 and so on.

채택된 답변

TADA
TADA 2018년 11월 28일
편집: TADA 2018년 11월 28일
a = rand(20,1);
c = mat2cell(a, [5,4,3,6,2], 1);
  댓글 수: 2
kitty varghese
kitty varghese 2018년 11월 28일
I am getting the following error
Input arguments, D1 through D2, should be vectors.
TADA
TADA 2018년 11월 28일
편집: TADA 2018년 11월 28일
yes, I wrote it wrong at first,
should work fine now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by