吾爱光设

 找回密码
 注册
会员须知
会员须知
实用帮助
实用帮助
查看: 4048|回复: 0

ASAP和matlab相互调用

[复制链接]
  • TA的每日心情
    开心
    2024-11-26 08:54
  • 签到天数: 773 天

    [LV.10]以坛为家III

    127

    主题

    350

    回帖

    18

    积分

    新手

    积分
    18
    发表于 2019-12-18 23:02 | 显示全部楼层 |阅读模式
    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.

    发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    联系我们|本论坛只支持PC端注册|手机版|小黑屋|吾爱光设 ( 粤ICP备15067533号 )

    GMT+8, 2024-11-26 17:38 , Processed in 0.093750 second(s), 22 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表