How to use words in a matrix?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Taylor Gates
am 18 Jul. 2018
Bearbeitet: Geoff Hayes
am 18 Jul. 2018
I'm trying to create a matrix with products on column 1 and price on column 2. When I try to use words in column one it gives me errors. How can I use words in a matrix to accomplish this?
0 Kommentare
Akzeptierte Antwort
Geoff Hayes
am 18 Jul. 2018
Bearbeitet: Geoff Hayes
am 18 Jul. 2018
Taylor - if you are mixing numbers with strings, then create a cell array which will allow you to have elements of different types. For example,
myData = {'Product 1', 10; 'Product 2', 20};
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices 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!