0

My situation here is that I need to send my program to my university's cluster which runs on Linux. To save file on my com locally using Windows, I simply use

fid = fopen('exp.txt', 'w');
fprintf(fid, '%6.2f %12.8f\n', y);
fclose(fid);

What is the Linux equivalent of this command if I want to save to a directory on the cluster for example /home/MyFolder/filename.txt? Do I use

mkdir('/home/MyFolder/')

Furthermore how do I specify a directory in Linux? I have no experience using Linux at all.

1 Answer 1

1

If you just start MatLab while you're in your desired directory (cd /path/to/dir/ to change current directory), your existing code will still work.

If you need a different working directory (e.g. to find scripts and other data files), fopen('/path/to/exp.txt', 'w'); should help.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.