QQ:2335298917 由于STK10 以后,STK10 与matlab 互联需要安装connector,网站上只有32bit 版本,因此将32bit connector 下载下来并安装。 网站介绍如下: MATLAB Connectors Setup and Installation MATLAB Interface setup Starting with STK 10, connectors are required to run AGI M-files and MEX files. STK MATLAB connectors simplify the setup of the MATLAB Interface by automatically configuring the MATLAB file path for a specific MATLAB version. For each supported version of MATLAB, AGI produces a connector, which can be downloaded from the link below: • 32-bit connector Installation instructions for the MATLAB Connectors. Supported MATLAB versions The following versions of MATLAB are supported in STK 10: 2008a, 2010a, 2010b, 2011a, 2011b, 2012a, 2012b, 2013a. 由于支持的matlab 版本原因,我选择了matlab2011b32bit 进行连接。安装顺序,先安装matlab2011b,再安装STK10,最后安装connector。 STK10 与matlab 互连的设置步骤 1) 将“STK 安装目录\bin\Matlab”文件夹中的“agiCleanPath.m”、“agiInit.m”、“stkInit.m”复制到“Matlab 安装目录\toolbox\local”文件夹中; 2) 启动matlab 和stk,将matlab 当前目录设为“STK 安装目录\bin\Matlab”,在 matlab 中运行指令“stkInit”。 3) 显示如下: >> stkInit STK MATLAB Interface: Loaded API at d:\Program Files (x86)\MATLAB\R2011b\bin\win32. Warning: mexConnect: Connecting to localhost:5001 这样,matlab 与 STK10 就连接好了,可以在 matlab 中进行各种命令的发送和设置,stk10 会有相应的动作。 以《STK 在计算机仿真中的应用》第 21 章的例子为例,运行结果如下: 将例子代码和文件放到 D 盘根目录下,并把 D 盘根目录加入 matlab 的 path 中,在 matlab中运行 STKTest,结果如下: >> STKTest Create a new scenario Set scenario time period Create a leidazhan1 Create a hangfangleida1 radar Create a leidazhan2 Create a haifangleida2 radar Create a new missle ans = double Compute the local horiz...