I'm running a chunk of matlab code called fit.m this way,
clear all;
load('/pathtomatfile/alldata.mat')
count = rxw1;
count = double(count);
x_cov = ltgbd;
alldata.mat has several data of interest, i.e.,
rxw1
rbg2
rfd1
wop3,
ltgbd,
etc.
I can run such script from the command line for a given data of interest (in my example count=rxw1),
matlab -nodisplay -nojvm -nosplash -r ${pathtoscript}fit -logfile lfile.txt
However, I need to automate the running so I can tell matlab to make count = any of the other datasets in the mat file. I.e., I'd like to the script in parallel for different datasets but I'd need something like:
matlab -nodisplay -nojvm -nosplash -r ${pathtoscript}fit -logfile lfile.txt DATAOFINTERESTHERE (i.e., rxw1 count will equal rxw1, etc.)
Is it possible to do what I am suggesting? How would I automate the script to run for any of the datasets I choose by giving the name of the dataset as an input parameter when I call the script?
Once I have that I plan to actually run them all in parallel by submitting jobs through LSF but giving the name of the data of interest as an input, something like this in mind:
bsub -q week -R'rusage[mem=8000]' \
"matlab -nodisplay -nojvm -nosplash -r ${pathtoscript}fit -logfile lfile.txt DATAOFINTEREST"
Sorry if it's too basic of a Q but I am not familiar with running matlab command line.