Convert images into .Mat files
39 次查看(过去 30 天)
显示 更早的评论
Hi guys i have 6 of this images. I want to try to make it into .mat files. Just like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1388144/image.png)
In the picture above, u can see that there is 3 images that has 65536 in size. Now i want to turn my 6 images into .mat files just like this picture above.
What kind of code do i use?? thanks
2 个评论
Dyuman Joshi
2023-5-19
编辑:Dyuman Joshi
2023-5-19
"In the picture above, u can see that there is 3 images that has 65536 in size."
Are you sure about that?
Ideally you can use a loop to achieve this, As you have named the images serially, but make sure that all the images are in the current directory.
for k=0:5
str = sprintf('chrome.%d.png', k)
I = imread(str);
out = sprintf('chrome%d.mat');
save(out, I)
end
采纳的回答
Piyush Dubey
2023-5-30
Hi Putra,
Images need not be converted to .mat extension. Images can be read using imread() function and then saved with .mat extension. More clarity can be obtained on a similar MATLAB Answer’s thread attached below:
Hope this helps.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!