convert matrix into cell

조회 수: 1 (최근 30일)
Leonardo Wayne
Leonardo Wayne 2016년 4월 18일
편집: Rajesh Dubal 2016년 4월 19일
How to convert selected motors into a cell but making the cell size 3x1 with the same values? in other words row 1 in cell will have 13161501100001,.....
  댓글 수: 1
Guillaume
Guillaume 2016년 4월 18일
What do you call a cell? There's no such thing in matlab's vocabulary.
There are cell arrays. Is that what you want? In which case, see Star's answer but you're probably better off keeping your selected_motors as it is, as a vector of numbers.
If it's the class of the data, int64, that is a problem, then please state that.

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 18일
a=int64(1:3)';
out=num2cell(a)

추가 답변 (1개)

Rajesh Dubal
Rajesh Dubal 2016년 4월 18일
편집: Rajesh Dubal 2016년 4월 19일
See help on cell2mat.
d=[1;2;3];
e=mat2cell(d);
Will create a variable 'e' which has the values 1,2,3 as contents of a cell
  댓글 수: 2
Guillaume
Guillaume 2016년 4월 18일
Rajesh, it's great that you are helping answer questions. However, please learn to format your answer appropriately. There's a Help button above each answer/comment box that gives more details.
Also, please test your answer before submitting it, as the example you've posted will result in an error.
Rajesh Dubal
Rajesh Dubal 2016년 4월 19일
편집: Rajesh Dubal 2016년 4월 19일
Thank you for the information, I have made appropriate changes now

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by