【发布时间】:2018-11-13 05:30:18
【问题描述】:
这是我正在尝试执行的一个简单的 Matlab 代码。
function result = scale(img, value)
result = value .* img;
end
dolphin = imread('dolphin.png')
imshow(scale(dolphin, 1.5));
错误提示:
Error: File: scale.m Line: 5 Column: 1
This statement is not inside any function.
(It follows the END that terminates the definition of the function "scale".)
我在这里做错了什么?
【问题讨论】:
-
scale 是 matlab 中已有的函数名。您应该尝试使您的函数名称更加独特,这样您就不会与现有函数重叠。
-
@Hojo.Timberwolf,我已将 scale.m 文件重命名为 myFunction.m。仍然出现同样的错误。
标签: matlab function image-processing