random pick cell array
3 ビュー (過去 30 日間)
古いコメントを表示
how to randomly picking in cell array? for example,i want to pick randomly one data in x.
x=[1;8;9;10;16]
0 件のコメント
回答 (1 件)
Paulo Silva
2011 年 5 月 7 日
x=[1;8;9;10;16]; %is one array not cell array
x(randi([1 numel(x)])) %show one random element of the array
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!