poster
2019-12-10, 20:48
在MatLab R2010B中,如何引用函数调用imageinfo返回的对象中的字段?我是
代码示例:
imagePropObj = imageinfo('imageFile.tif'); 这会弹出一个窗口,显示图像文件的各种属性。然后我尝试使用访问Width属性
imagePropObj.Width 但是我得到了错误
??? Attempt to reference field of non-structure array. 我不确定自己在做什么错。请帮忙。谢谢。
回答:
imageinfo将句柄返回到该图。那不是你想要的。我假设您实际上要使用IMFINFO (http://www.mathworks.com/help/techdoc/ref/imfinfo.html) ,它确实返回带有字段“宽度”的结构。
更多&回答... (https://stackoverflow.com/questions/4157841)
代码示例:
imagePropObj = imageinfo('imageFile.tif'); 这会弹出一个窗口,显示图像文件的各种属性。然后我尝试使用访问Width属性
imagePropObj.Width 但是我得到了错误
??? Attempt to reference field of non-structure array. 我不确定自己在做什么错。请帮忙。谢谢。
回答:
imageinfo将句柄返回到该图。那不是你想要的。我假设您实际上要使用IMFINFO (http://www.mathworks.com/help/techdoc/ref/imfinfo.html) ,它确实返回带有字段“宽度”的结构。
更多&回答... (https://stackoverflow.com/questions/4157841)