Running a function with a parameter from the command line
Show older comments
I am new to Matlab and realize this is probably a simple question, but I am unable to find a solution online. MATLAB starts, but issues the following error:
/home/ubuntu/code/run_grisli_single.m('/home/ubuntu/my_file.tsv'); exit;
|
Invalid use of operator.
Please let me know what I am doing wrong.
This is my command:
/usr/share/matlab/bin/matlab -nodisplay -nosplash -nodesktop -r "/home/ubuntu/code/run_grisli_single.m('/home/ubuntu/my_file.tsv'); exit;"
This is my script (run_grisli_single.m):
function A = run_grisli_single(varargin)
file = varargin{1}
% compute A;
% return A;
end
2 Comments
Fangjun Jiang
on 6 May 2024
remove .m from your command string
Harsh
on 6 May 2024
Try running the following command
/usr/share/matlab/bin/matlab -nodisplay -nosplash -nodesktop -r "/home/ubuntu/code/run_grisli_single('/home/ubuntu/my_file.tsv'); exit;"
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!