I did this steps and it didn't worked!
url_img =
name_file_img =
20141015-00:00.jpg
>> urlwrite(url_img, name_file_img); Error using urlreadwrite>getFileOutputStream (line 245) Could not open output file "C:\Users\Albm\Documents\MATLAB\2014\10\15\2014\10\15\2014\10\15\2014\10\15\20141015-00:00.jpg".
Error in urlreadwrite (line 69) [file,outputStream] = getFileOutputStream(inputs.filename);
Error in urlwrite (line 38) [f,status] = urlreadwrite(mfilename,catchErrors,url,filename,varargin{:});

 채택된 답변

matt dash
matt dash 2014년 10월 17일

1 개 추천

You just can't have a colon in a file name, that's all.

댓글 수: 2

Star Strider
Star Strider 2014년 10월 17일
Good pick-up!
I completely overlooked that.
Arthur Melo
Arthur Melo 2014년 10월 17일
Thanks everybody and sorry, but matt dash gave me the perfect answer, some times we forget too basics things. I don't know why. Thank you matt, now I have no problem.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 10월 17일

0 개 추천

You need to use imwrite() if you want to save an image, not urlwrite().

댓글 수: 4

This code saves the image to my computer just fine for me. Does it work for you?
% Specify the filename (URL).
filename = 'http://satelite.cptec.inpe.br/repositorio7/goes13_met10/goes13_met10_web/ams_afc_alta_jpg/2014/10/S11185873_201410150000.jpg';
% Read it in to a variable in my m-file.
rgbImage = imread(filename);
% Display the image.
imshow(rgbImage);
% Save the image to a file on my local hard drive.
imwrite(rgbImage, 'satellite image.jpg');
Mykola Ponomarenko
Mykola Ponomarenko 2022년 2월 11일
편집: Mykola Ponomarenko 2022년 2월 11일
In this example rgbImage is saved with additional lossess (with a re-compression). To save the original JPEG file one needs to use urlwrite function.
To get no additional losses, use PNG format
imwrite(rgbImage, 'satellite image.png');
Can you show an example of how you'd save your image array with urlwrite()? The documentation only shows how to save web pages as HTML format, not how to save image data in PNG format.
This code is perfect. Thanks @Image Analyst

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Communications Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by