Random index cell selection

3 views (last 30 days)
Bob Ebi
Bob Ebi on 26 Aug 2015
Answered: Walter Roberson on 26 Aug 2015
Hi,
I want to select a random text cell in a column. Is there a specific code that I can use for selection of a random text cell in a matrix that I have imported to Matlab?
So far, I have divided the imported matrix into num, txt and raw. But, I cannot go further. You can see my codes as following:
[num,txt,raw] = xlsread('D:\Norwegian\Ordbok\Ord.xlsx');
A = txt (:,1:5);
B = txt(:,6:9);

Answers (1)

Walter Roberson
Walter Roberson on 26 Aug 2015
B{ randi(numel(B)) }

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!