Filter löschen
Filter löschen

Form strings/numbers from matrix

2 Ansichten (letzte 30 Tage)
Natialol
Natialol am 31 Mär. 2013
Hello,
Looking for a way to join the horizontal elements of a matrix into a number.
[1 2 0; 0 2 6; 9 8 0; 0 0 2] to form [120; 026; 980; 002]
or {120,026,980,002}
Thanks

Akzeptierte Antwort

Cedric
Cedric am 31 Mär. 2013
Bearbeitet: Cedric am 31 Mär. 2013
If you want numbers:
>> A = [1 2 0; 0 2 6; 9 8 0; 0 0 2]
A =
1 2 0
0 2 6
9 8 0
0 0 2
>> A * [100;10;1]
ans =
120
26
980
2
and you can convert to string from there if needed.

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by