Quantcast

mat2gray not working when called from Perl only console

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mat2gray not working when called from Perl only console

amonterou
I have a script in perl that generates a .m file based on a series of parameters and then runs an octave algorithm through ticks like:

`octave my_script`;

And then I capture the results in a separate file. The problem is that even having installed the image package succesfuly mat2gray function is not working.
If I open manually octave like a separate console to be used manually, and call my script it does work perfectly. The issue appears only when calling the octave.exe from Perl. It shows:

error: `mat2gray' undefined near line 21 column 6

Which looks like the typical error you get when you don't have the image package. I already tried to iclude a line on my script at the very top to rebuild the package everytime my script runs, like so:

pkg rebuild -auto image;

But that didn't fix it. Anyone has seen this kind of odd behavior?

I'm using Octave 3.2.4, since I need that version due to some compatibility issues with other pieces of software that we need. And some plotting capabilities when called from perl don't work all that well. Just in case you were wondering.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mat2gray not working when called from Perl only console

Carnë Draug
On 3 December 2012 18:34, amonterou <[hidden email]> wrote:

> I have a script in perl that generates a .m file based on a series of
> parameters and then runs an octave algorithm through ticks like:
>
> `octave my_script`;
>
> And then I capture the results in a separate file. The problem is that even
> having installed the image package succesfuly mat2gray function is not
> working.
> If I open manually octave like a separate console to be used manually, and
> call my script it does work perfectly. The issue appears only when calling
> the octave.exe from Perl. It shows:
>
> error: `mat2gray' undefined near line 21 column 6
>
> Which looks like the typical error you get when you don't have the image
> package. I already tried to iclude a line on my script at the very top to
> rebuild the package everytime my script runs, like so:
>
> pkg rebuild -auto image;
>
> But that didn't fix it. Anyone has seen this kind of odd behavior?
>
> I'm using Octave 3.2.4, since I need that version due to some compatibility
> issues with other pieces of software that we need. And some plotting
> capabilities when called from perl don't work all that well. Just in case
> you were wondering.

You will have to show us the source (both perl and octave script). Do
you have "pkg load image" in your octave script? That's always good
practice, even if it's loading automatically in your system because
when you give it someone else, they may not have configured the same
way.

Carnë
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mat2gray not working when called from Perl only console

amonterou
I added on the first lines of my .m script the line you tell me and it worked perfectly.

pkg load image

Now there is no issue with the script.

Thanks a lot Carnë!!
Loading...