List functions on fprintf

How do you list something on fprintf? I want them in a column than kyou

2 个评论

And what do you want to appear in this list? Have you read "help fprintf" already?
I have read fprintf but i'm still a little bit confused about it.
I want it to display two columns the first is numbers and the second is a string

请先登录,再进行评论。

 采纳的回答

fprintf('%10.2f\n', YourMatrix)

3 个评论

Thanks this is a great help but what if the matrix was a string?
If you need to display a mix of numbers and strings on a single line, then you need to loop over each line. For example:
for K = 1:length(YourMatrix)
fprintf('%10.2f %s\n', YourMatrix(K), YourStrings(K,:));
end
One more question when i tried your way for some reason it would repeat what i typed for my whole matrix did I do something wrong?

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by