Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Limiting vectors to a certain number of rows

1 vue (au cours des 30 derniers jours)
Giovanni
Giovanni le 12 Déc 2013
Clôturé : MATLAB Answer Bot le 20 Août 2021
Hi, i have created a function that creates n lots of a matrix of 3 columns but different number of rows. How do i limit the number of rows of this matrixes to say 4 for each one?

Réponses (1)

Andrei Bobrov
Andrei Bobrov le 12 Déc 2013
n = 7;
out = arrayfun(@(x)rand(randi(4),3),1:n,'un',0);

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by