Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

renamed deconvlucy cannot work again?

24 views
Skip to first unread message

trison

unread,
Aug 8, 2011, 11:31:11 PM8/8/11
to
Dear all:
I tried to understand on the deconvlucy.m by copying it to another path as C:\Documents and Settings\msi\My Documents\MATLAB, and renamed it as mydeconvlucy.m. And then I used the code below:
I=imread('cameraman.tif');
PSF=fspecial('gaussian',7,0.01);
J1=deconvlucy(I,PSF);
that was ok. When I changed another command:
J2=mydeconvlucy(I,PSF);
the system send an error:
??? Undefined function or method 'padlength' for input arguments of type 'double'.
Error in ==> mydeconvlucy>parse_inputs at 285
[sizeI, sizePSF] = padlength(size(J{1}), size(PSF));
Error in ==> mydeconvlucy at 103
[J,PSF,NUMIT,DAMPAR,READOUT,WEIGHT,SUBSMPL,sizeI,classI,numNSdim]=...
The function mydeconvlucy was the same as deconvlucy, why mydeconvlucy was failed while deconvlucy was running well in doing the same task?

Thank you very much for your help!
Kind regards,
Trison

Bruno Luong

unread,
Aug 9, 2011, 1:35:27 AM8/9/11
to
"trison " <fuda...@yahoo.com.cn> wrote in message
> The function mydeconvlucy was the same as deconvlucy, why mydeconvlucy was failed while deconvlucy was running well in doing the same task?
>

It seems clear to me. There is another dependency source file/folder that you did not copy.

Bruno

Spandan Tiwari

unread,
Aug 9, 2011, 8:26:48 AM8/9/11
to
Try reloading the toolbox directories again using:

rehash toolbox

-Spandan

"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message
news:j1qguv$pnb$1...@newscl01ah.mathworks.com...

Steven_Lord

unread,
Aug 9, 2011, 9:16:57 AM8/9/11
to

"trison " <fuda...@yahoo.com.cn> wrote in message

news:j1q9lv$673$1...@newscl01ah.mathworks.com...

It appears DECONVLUCY depends on some private helper functions that are only
accessible from within the Image Processing Toolbox directory. Therefore
copying it to another directory will not work.

Why are you trying to modify this function?

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Spandan Tiwari

unread,
Aug 9, 2011, 9:32:04 AM8/9/11
to
I might have misunderstood the issue here. I suggested rehashing based on my
impression that you made your copy of deconvlucy in the folder
<matlabroot>\toolbox\images\images. If this is not the case, the rehashing
will not address the issue.

-Spandan

"Spandan Tiwari" <span...@mathworks.com> wrote in message
news:j1r92a$3p7$1...@newscl01ah.mathworks.com...

trison

unread,
Aug 9, 2011, 10:06:26 AM8/9/11
to
"Steven_Lord" <sl...@mathworks.com> wrote in message <j1rc09$dov$1...@newscl01ah.mathworks.com>...

I tried to catch the meaning of each code in deconvlucy, and to avoid any changes about it, so I copied it to a new M-file mydeconvlucy. Thank you very much for your advice. I learn a lot now.

Steven_Lord

unread,
Aug 9, 2011, 10:22:39 AM8/9/11
to

"trison " <fuda...@yahoo.com.cn> wrote in message

news:j1ret2$ok7$1...@newscl01ah.mathworks.com...

*snip*

> I tried to catch the meaning of each code in deconvlucy, and to avoid any
> changes about it, so I copied it to a new M-file mydeconvlucy. Thank you
> very much for your advice. I learn a lot now.

If you want to read through DECONVLUCY to try to understand it without
risking accidentally changing it, just make it read-only. You can do this by
right-clicking on the file in Windows Explorer and opening the file's
Properties or using the FILEATTRIB function.

dpb

unread,
Aug 9, 2011, 10:30:59 AM8/9/11
to
On 8/9/2011 9:22 AM, Steven_Lord wrote:
...

> If you want to read through DECONVLUCY to try to understand it without
> risking accidentally changing it, just make it read-only. You can do
> this by right-clicking on the file in Windows Explorer and opening the
> file's Properties or using the FILEATTRIB function.

Or use a file viewing tool instead of an editor...

--

Steven_Lord

unread,
Aug 9, 2011, 12:38:30 PM8/9/11
to

"dpb" <no...@non.net> wrote in message news:j1rgas$s1t$2...@speranza.aioe.org...

That works if you just want to read the code. If you want to step through
the code using the Debugger and examine the state at various points, which
is one technique I often use when attempting to decipher a piece of code,
you can do that without the Editor but it's much easier to do with it.

dpb

unread,
Aug 9, 2011, 1:48:04 PM8/9/11
to
On 8/9/2011 11:38 AM, Steven_Lord wrote:
...

> That works if you just want to read the code. If you want to step
> through the code using the Debugger and examine the state at various
> points, which is one technique I often use when attempting to decipher a
> piece of code, you can do that without the Editor but it's much easier
> to do with it.

Good point...

--

trison

unread,
Aug 9, 2011, 8:44:13 PM8/9/11
to
dpb <no...@non.net> wrote in message <j1rrsc$pq8$1...@speranza.aioe.org>...
> Thank you very much! I get a skill on learning Matlab now!
>
0 new messages