フィルターのクリア

how can i put cell value in a vector?

3 ビュー (過去 30 日間)
Mira le
Mira le 2019 年 12 月 18 日
回答済み: KALYAN ACHARJYA 2019 年 12 月 18 日
U =
1×2 cell array
[1×2 double] [1×2 double]
U contains these values in cell
U{1}
ans =
1 2
U{2}
ans =
2 3
s= []
I want to put the elements of U in s without duplicate value so I use this instruction: s=unique([U{:}])
this error "Cell contents reference from a non-cell array object." appear,

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 18 日
s=unique(cell2mat(U))

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2019 年 12 月 18 日
As discussed in your earlier question, you are overwriting all of U with your S variable, and after that U is no longer a cell array.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by