Effacer les filtres
Effacer les filtres

Retrieve Spesific Row of Cell Matrix

1 vue (au cours des 30 derniers jours)
Angga Lisdiyanto
Angga Lisdiyanto le 30 Juin 2016
Commenté : Angga Lisdiyanto le 30 Juin 2016
Hi, i want to retrieve spesific row data of cell matrix or with a random method. In example :
cell_matrix = {
'i', 'hate', 'war';
'i', 'likes', 'peace';
'i', 'love', 'cats';
}
Then i want below result :
first_row =
'i' 'hate' 'war'
random_row =
'i' 'likes' 'peace'

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 30 Juin 2016
first_row = cell_matrix(1,:);
random_row = cell_matrix(randperm(size(cell_matrix,1),1),:);
or
random_row = cell_matrix(randi(size(cell_matrix,1)),:);

Plus de réponses (0)

Catégories

En savoir plus sur Desktop dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by