How to use words in a matrix?

15 ビュー (過去 30 日間)
Taylor Gates
Taylor Gates 2018 年 7 月 18 日
編集済み: Geoff Hayes 2018 年 7 月 18 日
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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by