convert matrix into cell
1 次查看(过去 30 天)
显示 更早的评论
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
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.
采纳的回答
更多回答(1 个)
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
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
2016-4-19
编辑:Rajesh Dubal
2016-4-19
Thank you for the information, I have made appropriate changes now
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!