Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用以下命令在 Matlab 中读取图像,正如我在 Matlab 文档中找到的那样:
A = imread(d:/img,png)
但问题是 Matlab 无法读取路径并说:Error: Unexpected MATLAB operator.
Error: Unexpected MATLAB operator.
我还尝试在文件路径中使用 /、//、\ 和 \,但它们都不起作用。
请让我知道如何让它工作。
您需要'在文件名周围加上文件名,并且文件可能已命名'img.png'(点而不是逗号)
'
'img.png'
A = imread('d:/img.png')
平台也有区别:
Microsoft® Windows® 平台上的路径:
I = imread('c:/tools/goodstuff/img.png')
UNIX® 平台上的路径:
I = imread('/home/tools/goodstuff/img.png')