Randomizing samples without losing track on labels
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Vivek Raj
il 13 Set 2023
Commentato: Akshat Dalal
il 16 Set 2023
I have 5 different images data and I want to shuffle/randomize each time when displayed. I want to keep track on which image I am showing. How I can do it in matlab? For example I have images of cat, dog, cows, lions and tigers. I want to show them to users for 5 trials. How I can keep a track on their labels. Is there any data structure like keys and values in python which can be implemented in Matlab?
0 Commenti
Risposta accettata
Akshat Dalal
il 13 Set 2023
Hi Vivek,
The dictionary object will be helpful for your problem - https://in.mathworks.com/help/matlab/ref/dictionary.html
2 Commenti
Akshat Dalal
il 16 Set 2023
Hi Vivek,
There are many examples provided in the link. I'll attach one of them here, but you could always go back to explore more.
wheels = [1 2 3];
names = ["Monocycle" "Bicycle" "Tricycle"];
d = dictionary(names,wheels)
d("Tricycle")
d("Bicycle") = 2.5
d("Car") = 4
names2 = ["Truck" "Motorcycle" "Sixteen-Wheeler"];
wheels2 = [4 2 16];
d(names2) = wheels2
d("Truck") = [] % Remove entries by assigning an empty array to an existing key.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!