how can store string and number in a matrix?

9 ビュー (過去 30 日間)
mehdi
mehdi 2013 年 7 月 30 日
i want to store string and numbers in a matrix for example store word 'matlab' in one cell and 'ver' & '12' in other cells

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 7 月 30 日
A={'matlab', {'ver',12}}
  1 件のコメント
mehdi
mehdi 2013 年 7 月 30 日
thanks

サインインしてコメントする。

その他の回答 (1 件)

Evan
Evan 2013 年 7 月 30 日
編集済み: Evan 2013 年 7 月 30 日
You can use a cell array for storing values of differing datatypes:
A = {'matlab' 'ver' 12}
You can also use a cell array to store regular arrays of different sizes:
B = {[3 6 4 2],eye(3);1:4,magic(5)}
For more on cell arrays, including how to access the elements of arrays stored within them, see here:
  1 件のコメント
mehdi
mehdi 2013 年 7 月 30 日
thanks alot

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumeric Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by