필터 지우기
필터 지우기

seprating a vector into sub vectors ,

조회 수: 1 (최근 30일)
som
som 2013년 4월 12일
Hi all,
I have a vector like "a" . I want to classify "a" vector into a cell including 4 seprated vector i.e. A{1}(1:4), A{1}(5:8), A{1}(9:12), A{1}(13:16).
as shown below:
a=[21,22,23,25,28,33,36,41,54,55,57,58,60,71,80,95;];
What I want to outline is the same as
A{1}(1:4) = [21,22,23,25]; A{2}(1:4) = [28,33,36,41]; and so on.
How can I write this program?
Thanks in advance.
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 4월 12일
What you outlined is the same as
A{1}(1:16) = a;
Perhaps you wanted an outline similar to
A{1}(1:4) = [21,22,23,25]; A{2}(1:4) = [28,33,36,41]; and so on?
som
som 2013년 4월 12일
편집: som 2013년 4월 12일
hi, thanks for your comment. I corrected my question.

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 12일
A = mat2cell(a, 1, 4 * ones(1,length(A)/4));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by