Matlab - 类型Double的输入参数的未定义错误 [英] Matlab - Undefined Error for Input Arguments of Type Double

查看:473
本文介绍了Matlab - 类型Double的输入参数的未定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个功能,它执行 conv2(h1,h2,A)& conv2(...'shape')不使用内置函数。 (速度目前不是问题)。如下所定义: http://www.mathworks.co.uk/help /matlab/ref/conv2.html

I'm trying to write a function that does what conv2(h1,h2,A) & conv2(...'shape') does without using the built-in function. (speed is currently not an issue). as defined here: http://www.mathworks.co.uk/help/matlab/ref/conv2.html

这些是我的命令:

    imgC = imread('camerman.tif');
    imgC = double(imgC);

    sigma = 1;
    inp = (-1 .*2.5 .*sigma):1:(2.5 .* sigma);                                  
    gauss1d = (1/(sigma .* sqrt(2*pi))).*exp(-(inp.^2/(2.*sigma.*sigma)));      
    gaussprime = diff(gauss1d);       

    x = conv2fft(gaussprime,1,imgC , 'same');   
    y = conv2fft(1,gaussprime.',imgC , 'same'); 
    blur = conv2fft (gauss1d, gauss1d, imgC );

这是我的错误:

    Undefined function 'convfft' for input arguments of type 'double'.
    Error in conv2fft (line 81) `if size(convfft(a(1,:),r),1)==1`

如果我运行相同的命令,但使用 conv2 函数:

If I run the same commands but use the conv2 function:

    imgC = imread('camerman.tif');
    imgC = double(imgC);

    sigma = 1;
    inp = (-1 .*2.5 .*sigma):1:(2.5 .* sigma);                                  
    gauss1d = (1/(sigma .* sqrt(2*pi))).*exp(-(inp.^2/(2.*sigma.*sigma)));      
    gaussprime = diff(gauss1d);       

    x = conv2(gaussprime,1,imgC , 'same');   
    y = conv2(1,gaussprime.',imgC , 'same'); 
    blur = conv2(gauss1d, gauss1d, imgC );

它工作正常吗?...我一直在搜索,盯着这段代码几个小时。我只是看不到它。任何人都注意到我的功能有什么问题?

It works fine?... I've been searching around and staring at this code for hours. I just can't see it. Anyone notice what is wrong with my function?

推荐答案

未定义的函数'xxx' 'double'通常表示函数 xxx 不在路径上。

Undefined function 'xxx' for input arguments of type 'double' typically indicates that the function xxx is not on the path.

为了确认这是确实的问题,在命令行中键入 which convfft ,因为哪个应该指示Matlab知道的位置该文件位于。

To confirm that this is indeed the issue, type which convfft at the command line, since which should indicate where Matlab knows the file is located.

如果找不到该文件,请确保它存在于您的计算机上,并将文件的父文件夹添加到Matlab路径。

If the file is not found, make sure that it exists on your computer, and add the file's parent folder to the Matlab path.

这篇关于Matlab - 类型Double的输入参数的未定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆