- display those strings to the command window?
- create or display a cell array with text and numeric entries?
add index to matrix's rows
2 次查看(过去 30 天)
显示 更早的评论
I have a matrix like below:
A= [1 2 4
3 4 2
2 4 5]
With n rows and three columns. I would like to create the following
1: 1 2 4
1: 3 4 2
1: 2 4 5
Thank you all in advance.
2 个评论
the cyclist
2016-6-1
Can you be more specific about what you mean by "I would like to create the following"? For example, do you want to
Please give us more detail.
采纳的回答
the cyclist
2016-6-1
编辑:the cyclist
2016-6-1
Here's one way:
fprintf('1: %d %d %d\n',A')
For more complicated examples, you might want to read about the formatSpec in the documentation for fprintf.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!