フィルターのクリア

what does {:} mean?

48 ビュー (過去 30 日間)
sadel
sadel 2011 年 6 月 25 日
Hi all!!
when I use a variable with this {:}, what does it mean?

採用された回答

Matt Fig
Matt Fig 2011 年 6 月 25 日
When used alone, it means to display all contents of a cell array.
C = {magic(3);'how';rand(1,2);'pizzaz';magic(8)};
C{:}
When passed to a function, it will form a comma-separated list. For example:
C = {magic(3);magic(2)}
isequal(C{:}) % This is the same as isequal(C{1},C{2})
Now change it to:
C = {magic(3);magic(3)}
isequal(C{:}) % This is the same as isequal(C{1},C{2})

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by