java - how to run a jar file from a matlab code? -
if have .jar
file takes 2 command line arguments. how can call matlab .m
file? can call jar file command line this:
jar -jar art.jar ex.xls 0
you can use system() function. e.g.:
[status result] = system('java -jar art.jar ex.xls 0');
if need pass variables parameters, have convert them strings , concatenate them (with space separator). e.g.:
jarfile = 'art.jar'; xlsfile = 'ex.xls'; n = 0; commandtext = ['java -jar ' jarfile ' ' xlsfile ' ' num2str(n)]; system(commandtext);
Comments
Post a Comment