character vector vs scalar string (size comparison).
18 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Osama Alkurdi
am 10 Nov. 2020
Bearbeitet: Stephen23
am 11 Nov. 2020
can any one explain to me why the character vector 'matlab' have a smaller size than the scalar string "matlab" despite that they carry the same information, can any one explain this in simple answer, and can you give me links explain how matlab store data?
0 Kommentare
Akzeptierte Antwort
Stephen23
am 10 Nov. 2020
Bearbeitet: Stephen23
am 11 Nov. 2020
The string class is basically a fancy container class for character vectors. That is to say, inside every string element is a character vector, so bytes_string > bytes_character will always hold true for the "same" text.
Of course because the string class is a container class, it also has its own overhead, as described here:
Unfortunately this page has not been updated for string arrays, but the information given for cell arrays will be similar:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings 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!