Function works on Windows but not Linux

Click For Summary

Discussion Overview

The discussion revolves around a technical issue regarding the execution of a function, 'largestcomponent.m', which works on Windows but fails on a Linux system. Participants explore potential reasons for the discrepancy, focusing on path settings and input argument types.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant reports that the function runs successfully on Windows but not on Linux, receiving an error message related to undefined function or method.
  • Another participant suggests ensuring that the directory containing the function is included in the path settings.
  • A different participant encourages experimentation, proposing to test with a trivial function to verify if the file is being accessed correctly.
  • The original poster later confirms that the issue was indeed related to the path settings, despite having checked them previously.

Areas of Agreement / Disagreement

Participants generally agree that path issues may be the cause of the problem, but there are differing suggestions on how to troubleshoot the issue effectively.

Contextual Notes

Limitations include the lack of detailed information on the specific error message and the exact nature of the input arguments being used.

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.
 

Similar threads

Replies
3
Views
3K
Replies
13
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 24 ·
Replies
24
Views
4K
Replies
9
Views
3K
  • · Replies 12 ·
Replies
12
Views
5K
  • · Replies 45 ·
2
Replies
45
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K