How to use words in a matrix?

15 次查看(过去 30 天)
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?

采纳的回答

Geoff Hayes
Geoff Hayes 2018-7-18
编辑:Geoff Hayes 2018-7-18
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 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by