Am new to Matlab.if i use imshow funtion,matlab shows error in the built in function..how can i overcome this problem?

4 次查看(过去 30 天)
Am new to Matlab.if i use imshow function in my program,matlab shows error in the built in function..how can i overcome this problem?
  4 个评论
Steven Lord
Steven Lord 2018-2-16
That doesn't look like the FULL error message. It shows where the problem occurred but not what the problem is. As Guillaume said, show everything in red.
Priya Dharsini
Priya Dharsini 2018-2-16
| _Attempt to execute SCRIPT image as a function: C:\Users\admin\Documents\MATLAB\image.m
Error in images.internal.basicImageDisplay (line 24) hh = image(cdata, ...
Error in imshow (line 293) hh = images.internal.basicImageDisplay(fig_handle,ax_handle,...
Error in hh (line 5) imshow(u);

请先登录,再进行评论。

回答(1 个)

Guillaume
Guillaume 2018-2-16
Now that we've got the full error message, it's clear what the problem is.
Rename your image.m script to something else. imshow is trying to use matlab's own image function but because files in your current directory take priority it's calling your image script instead. We say that your script shadows the image function.
Other functions that are commonly shadowed by mistake are sum, mean, table, cell, struct, var, i and j. Don't use these as functions, scripts or variable names.

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by