如何batch跑matlab程序

假设我们evaluation 的dataset 有n个。 each dataset has different name. Thus, we need to run our program in a batch way.

1. 

把所有的命令都写到一个.m 脚本里面

e.g. 

demo('../dataset/FilterDataset/Format3/','./result/', 'Arts',5)
demo('../dataset/FilterDataset/Format3/','./result/', 'Watches',5)
demo('../dataset/FilterDataset/Format3/','./result/', 'Cell_Phones_Accessories',5)
demo('../dataset/FilterDataset/Format3/','./result/', 'Jewelry',5)

2. 

matlab -nodesktop -nodisplay < run.m > run.log 


output information would be written in run.log file. 


3. use tic toc record the elapsed time

你可能感兴趣的:(如何batch跑matlab程序)