Select some elements from a given matrix

1 visualizzazione (ultimi 30 giorni)
Hello everyone, I have a matrix something like
m=[0.34,0.000009,0,2, 0,0.4,0.00087];
what i want is to pick randomly 3 elements from that matrix, i am really stuck , can anyone help?

Risposta accettata

James Tursa
James Tursa il 25 Mar 2015
Modificato: James Tursa il 25 Mar 2015
Assuming you don't care about the order in which they are selected:
If you want to preserve the original ordering, then:

Più risposte (0)


Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by