Numbering images using function 'websave'.
Mostrar comentarios más antiguos
Hi
I created a cell (10 x 1) and stored 10 web URLs in the cell.
The URL would look something like 'http://juliandance.org/wp-content/uploads/2016/01/RedApple.jpg'
I would like MATLAB to read each line of URL in the cell and try to save it as a .jpg file using function 'websave'.
However, not all 10 URLs are valid URLs. Some of it can be invalid and does not lead to any image.
What I would like to do is:
Try to save the first URL, if it can be saved as a .jpg file, name it '01.jpg'. Then move on to the second URL, if it can be saved, name it '02.jpg'; if it can't be saved, move on to the third URL, if it still can not be saved, move on to the fourth URL...and so on and so forth.
If out of 10 URLs it only successfully saved 5 images, regardless the 5 working URLs might be the 1st,3rd,5th,7th and 9th URL, I would still like to name the image in a continuous number from 1-5, rather name them 01.jpg, 03.jpg, 05.jpg, 07.jpg and 09.jpg.
So what is the logic relationship between the URL number and the image number?
Many thanks!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Scope Variables and Generate Names 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!