How do I write a function that contain a for loop to go through my filesname to find a match?
Mostrar comentarios más antiguos
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}
Respuestas (1)
Thorsten
el 29 de Oct. de 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 comentarios
Josephine Ng
el 29 de Oct. de 2015
Josephine Ng
el 29 de Oct. de 2015
Josephine Ng
el 29 de Oct. de 2015
Josephine Ng
el 29 de Oct. de 2015
Thorsten
el 30 de Oct. de 2015
You don't Need a for loop, just use the line I've posted above.
Josephine Ng
el 2 de Nov. de 2015
Thorsten
el 4 de Nov. de 2015
E must be 1 x N or N x 1.
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!