After reading your whole thread, I think you would find life much easier just running your matlab script using the normal graphical interface. Leave it on overnight, and see the results in the morning.
Anyway, answering your specific questions, and some comments:
This is my runJob.txt file:
It is normal (and the article you reference assumes) that files like runJob do not have a .txt extension. You could either rename the file in Finder, or you could use the .txt extension below.
Code:
#! /bin/csh
nohup matlab -nodisplay < /Users/josh/Documents/MATLAB/Class/559/p2/BreakDown/10bit/START.m> /Users/josh/output.txt &
That doesn't look too bad, but you need to be in the matlab directory (or have it in your path - you allude to this below) in order for the script to work. I prefer to put the full path of the matlab executable in the script, for example (replace the word "matlab" above with something like this: look in the applications folder in finder to find the matlab name)
Code:
/Applications/MATLAB_R2008a/bin/matlab
or for you, perhaps:
Code:
/Applications/MATLAB6p5/bin/matlab
then you can put both your csh script and matlab script in the same directory or at least not so far away on the path. If your START.m calls any of your functions, you may need to put a
Code:
addpath /Users/josh/Documents/MATLAB/Class/559/p2/BreakDown/10bit/
at the start of START.m.
not sure but the output.txt was not created by my execution of:
Didn't you get an error when you did this (the error would start with "usage ...")? It shouldn't have found the file, since yours seems to be called runJob.txt, not runJob. You need to try it with runJob.txt.
Anyway, all (for your purposes) that chmod does is make it executable (i.e. change the file type to a file that is allowed to run commands), so that you can run it, it doesn't actually run it. After the chmod, you need to type
to run it.
I added the suggested code for an email to the matlab file and I do not get a confirmation email
should this be put in my runJob.txt: #! ?
therefore I am assuming it has not opened the file
I don't think that matlab ever got run, let alone STARTUP.m. The suggested code should go in STARTUP.m not runJob.txt, since unless you have a quit in STARTUP.m the csh script will never get past calling matlab.
I wouldn't worry about the email thing until you get output.txt working. And before trying to put it in STARTUP.m, I'd test it in terminal: try typing:
Code:
mail -s abc yourname@youraddress
then some text, then Ctrl-D at the start of a line so see if mail is set up. If not, you have some more work to do on that before trying to put in it an matlab script.
are there any rules on format in the runJob.txt ?
Yes, it has to be a plain text file, and it has to contain commands, such as matlab, chmod etc, and many more. Since you start the file (on Mathworks suggestion) with csh, commands need to be in the c shell format (you probably won't have to worry about this if you're just using the normal things you can type in the terminal). I usually use bash (as I think most mac users do, since it's the default) instead of csh. But I wouldn't worry about any of that until you can get matlab running from the script.
I get this error:
matlab: No MATLAB bin directory for this machine architecture.
ARCH = maci6
Is this relative to the issue?
Could be. Can you get matlab to run with the usual graphical user interface on your system? Are you sure the error says "ARCH = maci6" and not maci64? The error means that the version you are trying to run (6.5) doesn't have an intel mac (64bit if it is maci64) executable. Version 7.4 was the first official Intel Mac version. You may still be able to run it in rosetta, just don't worry about sudo ln. If your script doesn't work, you could start by adding the option -nojvm to the matlab call in your runJob script. I can't check this because I only have intel mac versions of matlab. Anyone?
Code:
cd /usr/local/bin
sudo ln -s /Applications/MATLAB6p5/bin/matlab .
rehash
to add matlab to your shell path
That doesn't add matlab to your shell path, it creates a link to the executable, like the icons you may have on your desktop. I wouldn't bother with it.
Hope this helps, but i'd say the best idea would be to run matlab graphically to get your work done. In the meantime, play around with commands in terminal to get used to the paths etc first. Start with pwd, cd, chmod, ls. Use "man pwd" etc to get help on what they do.
I hope you don't find any of the above patronizing, you may be a computer whizz, these are just the things that I thought may help based on your queries.