Function works on Windows but not Linux

AI Thread Summary
The discussion centers around an issue with running the 'largestcomponent.m' function on a Linux machine, specifically Ubuntu 10.04 LTS, after successfully running it on a Windows 7 Enterprise SP 1 system. The user encounters an "Undefined function or method" error, indicating a potential problem with the function's accessibility or input type. Suggestions include verifying the file's path and ensuring the function is in the correct directory, as well as testing with a simple function to confirm if the file is being reached. Ultimately, the problem was identified as a path issue, despite the user's initial belief that it had been checked thoroughly.
Old Guy
Messages
101
Reaction score
1
I downloaded largestcomponent.m today and it runs fine on my PC (Win 7 Enterprise SP 1) but when I try it on my Linux machine (Ubuntu 10.04 LTS) I get this message:

? Undefined function or method 'largestcomponent' for input arguments of type 'double'.

Even if I put the function file in the same directory as the input it doesn't work on the Linux machine. Any suggestions?
 
Physics news on Phys.org
make sure your 'set path' included the directory it's in.

the only other thing I can think of is you are accidentally handing a double to it when it should be something else.
 
get creative, don't be afraid to try stuff...nothing is going to happen, it is just a computer program...so, put your detective hat and try stuff.

to start, I would put a trivial function with no arguments...just to see if you are actually reaching such file, like mentioned before (path issues?)
 
Thanks to you both. Ultimately it was a path issue, although I thought I had checked that thoroughly before I posted.
 
Back
Top