How do I write a function that contain a for loop to go through my filesname to find a match?
Afficher commentaires plus anciens
I currently collected a set of "name_list" together with a set of "numoflikes_list". Each name has certain num of likes attached to it. (i.e 123456789.jpg, 345 likes; 1432546435.jpg, 23 likes)
And I would like to write a function that go through all my image_name in a folder to find a match with the "name_list" that I have collected and eventually obtaining the num of likes that is associated with my image name.
This is what I have so far, was stuck and not sure how to write the for loop for this function:
function numofLikes=get_num_of_likes(image_name,name_list,numoflikes_list)
for i=1:size(name_list, 1)
name_list{i}
Réponses (1)
Thorsten
le 29 Oct 2015
It a one-liner; your probably do not want to write a function for it
nol = numoflike_list(strcmp(image_name, name_list));
9 commentaires
Josephine Ng
le 29 Oct 2015
Josephine Ng
le 29 Oct 2015
Josephine Ng
le 29 Oct 2015
Josephine Ng
le 29 Oct 2015
Thorsten
le 30 Oct 2015
You don't Need a for loop, just use the line I've posted above.
Josephine Ng
le 2 Nov 2015
Thorsten
le 4 Nov 2015
E must be 1 x N or N x 1.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!