필터 지우기
필터 지우기

random pick cell array

조회 수: 3 (최근 30일)
Sahab
Sahab 2011년 5월 7일
how to randomly picking in cell array? for example,i want to pick randomly one data in x.
x=[1;8;9;10;16]

답변 (1개)

Paulo Silva
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

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by