vendredi 7 janvier 2022

How can I make matlab select a random external file

I have several external files that I read in using readmatrix(). so:

one=readmatrix();
two=readmatrix();
three=readmatrix();

I then put them into an array,

A=[one two three]

Now how can I make the program choose one of those files randomly, I tried:

x=A(randi(length(A),1))

But then it chooses random elements of those files, so how can I make it choose a file itself so that I can use if x==one ....

Please note im really new to coding and this is my first project.




Aucun commentaire:

Enregistrer un commentaire