运行MATLAB代码在Windows
问题描述:
下面是我.bat文件运行MATLAB代码在Windows
phreeqc first_trial_um_b.pqi
matlab -sd "C:\trialbatch" -r "clean_output.m"
matlab -sd "C:\trialbatch" -r "getCa.m"
pause
的PHREEQC部分使用的代码工作得很好,但是MATLAB代码并不会自动运行。当我在DOS下手动输入matlab代码时,它完美地工作。
答
什么类型的文件是phreeqc?如果它是一个批处理文件:phreeqc.bat,那么它后面的行将永远不会被执行。要修复它,您必须包含一个CALL命令来执行phreeqc:
call phreeqc first_trial_um_b.pqi
matlab -sd "C:\trialbatch" -r "clean_output.m"
matlab -sd "C:\trialbatch" -r "getCa.m"
pause
感谢您的回答。 Phreeqc是一个建模程序,first_trial_um_b.pqi是模型输入。这在.bat文件中按预期运行。但是,由于某些原因,在完成这个phreeqc步骤之后,matlab不会被“调用”。 – raincity1199 2012-02-21 17:18:30
好吧,设法通过在matlab之前添加调用并在matlab之后稍微改变术语来实现它。感谢您的输入,@Aacini! – raincity1199 2012-02-22 01:45:47