Filter löschen
Filter löschen

List functions on fprintf

1 Ansicht (letzte 30 Tage)
Abra dog
Abra dog am 31 Okt. 2011
How do you list something on fprintf? I want them in a column than kyou
  2 Kommentare
Jan
Jan am 31 Okt. 2011
And what do you want to appear in this list? Have you read "help fprintf" already?
Abra dog
Abra dog am 31 Okt. 2011
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 31 Okt. 2011
fprintf('%10.2f\n', YourMatrix)
  3 Kommentare
Walter Roberson
Walter Roberson am 31 Okt. 2011
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
Abra dog
Abra dog am 1 Nov. 2011
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?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by