imread with new name
古いコメントを表示
I want to pre-load images before displaying them later. In order to do so, I need to save them with different names. Here is the code to loop through the folder of images:
for i=1:50
Names=imageNames{i};
Number=num2str(i);
NewName=strcat('ImageID_','Number);
NewName=imread(Names);
end;
But, I'd like the images to be saved as a variable string (e.g., "ImageID_1", "ImageID_2", etc.) but it is instead saving the image as "NewName"
1 件のコメント
Stephen23
2022 年 8 月 22 日
"I'd like the images to be saved as a variable string (e.g., "ImageID_1", "ImageID_2", etc.)"
And force yourself into writing slow, complex, inefficent code that you would need to access those variable names:
The simple, efficient, recommended solution is to use indexing into one array (e.g. a cell array), just as the documentation shows:
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Processing and Computer Vision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!