1. Call ASAP from Matlab, run a file, for example, customer.inr, obtain results, output the results to txt file (or directly to Matlab)
This is basically running ASAP in batch mode. We call the ASAPkernel in batch mode using the RABETP.EXE executable, using the scriptfile name as an argument. So to run MYSCRIPT.INR as an ASAP script, you wouldneed to invoke from Matlab a system call like
RABETPMYSCRIPT.INR /B
The/B avoids any prompting and assumes you want to simply run the script named inthe argument. See the Help topic "batch mode" for a few otherdetails. Of course, the RABETP executable must with be in the environment PATH.I would suggest putting the ASAP script to be executed in the local directorythat Matlab files are working in. Since this is the batch mode of theASAP kernel, we should not expect to use ASAP GUI commands.
2. Read in the results from ASAP to Matlab, he will precede these data in Matlab.
You must be sure that the script outputs any data needed to forreturn to Matlab using files such as user-formatted text files in ASAP.
3. Return the proceeded data to ASAP as new starting parameters,run ASAP again.
I would suggest trying to parameterize the ASAP model usingvariables, and the write a text file in Matlab to update the variables usingASAP variable assignments of the form
MYVAR1=0.7637
MYVAR2=13.67
A text file with this form could then simply be $READ into ASAPwith each batch run. If more complex changes to the model are required, Iwould recommend keeping the parts that change in a separate file that ASAPcan $READ in.
4. Do above 3 steps over and over again.
Once you can do it once or twice, I think doing it repetitivelywill be no problem.