필터 지우기
필터 지우기

Could anyone help me how to group into 4 sets.

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2019년 9월 20일
편집: Stephen23 2019년 9월 22일
I ma having a matrix
A=[2 3 1 4 5 6]
i used the command
NN = num2cell(num2cell(A),2)
,which gives the following result
{2} {3} {1} {4} {5} {6}
If i use the command
NN= num2cell(num2cell(A,2),2)
it gives the following result
{1 2 3 4 5 6}
Could anyone help me how to get the result in the following manner
{2 3} {1 4 5} {6}
  댓글 수: 1
darova
darova 2019년 9월 20일
What if criterion of grouping?
Why
{2 3} {1 4 5} {6}
And not
{2 3} {1 4 5 6}

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

답변 (1개)

Raj
Raj 2019년 9월 20일
Use this:
NN = mat2cell(A,[1],[2,3,1])
  댓글 수: 4
Stephen23
Stephen23 2019년 9월 22일
편집: Stephen23 2019년 9월 22일
jaah navi: you have been using MATLAB for more than two years.
During that time you have asked us every ten minutes to solve basic problems for you, most of which you could solve yourself by reading the documentation.
Rarely do you make any attempt to understand what an error message is telling you.
Rather than relying on us to write your very basic code for you, perhaps you should start reading documentation, trying examples, looking at FEX submissions, debugging, and doing it yourself. Note that this is in your interest because you would actually make progress much faster than you are now.
Your current approach to writing code (relying on other people to write every step of your algorithm and relying on other people debugging every tiny error message) is, in the long term, not efficient.
darova
darova 2019년 9월 22일
+1

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by