Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MATLAB:websave函数不';不要保存图像_Matlab - Fatal编程技术网

MATLAB:websave函数不';不要保存图像

MATLAB:websave函数不';不要保存图像,matlab,Matlab,我使用以下函数将地图从保存为png文件,如下所示 f_name='abc.png'; url='https://www.mapquest.com?center=1.34,103.683' %other parameters also go through the url. websave(f_name, url); 图像已保存,但由于以下错误而无法显示 Error using imread>get_format_info (line 543) Unable to determine

我使用以下函数将地图从保存为png文件,如下所示

f_name='abc.png';
url='https://www.mapquest.com?center=1.34,103.683'

%other parameters also go through the url.

websave(f_name, url);
图像已保存,但由于以下错误而无法显示

Error using imread>get_format_info (line 543)
Unable to determine the file format.
Error in imread (line 391)
        fmt_s = get_format_info(fullname);
随后,下面的行也会抛出一个错误

[M, Mcolor] = imread(filepath);
打开图像时,将显示一条消息

不支持文件格式

但是,如果将其扩展名更改为例如
html
,它会尝试加载实际的网页显示


任何线索都将受到高度赞赏

经过一番研究,我终于找到了这样做的方法

在这方面使用了静态API,并可与谷歌、Mapquest等地图一起使用。


这些静态API将地图的网页转换为其各自的图像,以Mapquest为例,可以使用您指向的URL不是图像的URL,而是网页的URL。Matlab不是浏览器,因此无法以任何方式呈现。websave设计用于处理已经是图像的web资源<代码>websave('test.png','https://www.sample-videos.com/img/Sample-png-image-100kb.png');将保存一个测试图像,然后您可以打开。我需要导入此网页作为绘图的背景。我如何实现此任何解决方案@你不能,用Matlab不行。这不是适合这项工作的工具。如果您仍然认为需要这样做,那么您正在研究自动浏览器控制,使用webdriver等工具控制chrome,或使用phantonjs在节点服务器中渲染。你真的需要问问自己,你是否真的需要这个,因为这并不简单。谢谢@eutransmish你的上述回答为我做了正确的工作。谢谢!