admin管理员组

文章数量:1531663

2024年1月31日发(作者:)

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安装目录binMatlab”文件夹中的“agiCleanPath.m”、“agiInit.m”、“stkInit.m”复制到“Matlab安装目录toolboxlocal”文件夹中;

2) 启动matlab和stk,将matlab当前目录设为“STK安装目录binMatlab”,在matlab中运行指令“stkInit”。

3) 显示如下:

>> stkInit

STK MATLAB Interface: Loaded API at d:Program Files (x86)MATLABR2011bbinwin32.

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 horizontal-referenced elevation angle ...

Compute a long range air intercept

Create an external state file and tell STK to load it.

图形如下:

STK10场景如下:

QQ:2335298917

附录:

MATLAB Interface to STK Setup Guide

This guide provides instructions for setting up the interface between MATLAB and STK 10.

Prerequisites

A supported version of MATLAB installed (Check /matlab for a list of

MATLAB versions supported by STK 10.)

STK 10 installed

STK Integration license

A valid STK-MATLAB configuration. For diagrams of valid 32-bit and 64-bit

configurations of MATLAB and STK, click here.

Installing an STK MATLAB Connector

The STK MATLAB Connector is the interface that enables communication between MATLAB

and STK.

To install the connector:

1. Browse to the MATLAB_Connectors or MATLAB_Connectors_X64 folder on the STK

DVD, click on and follow the install instructions. (You can also download

the latest MATLAB Connector from /matlab.)

2. To confirm that the installed version of MATLAB is connectable, start STK, go to the

Edit menu and select Preferences->MATLAB.

The MATLAB file path is automatically configured to find AGI M-files and MEX files. If

you need to reset the MATLAB file path, click Refresh MATLAB Path. (You can also

reset the MATLAB file path by selecting Refresh MATLAB Path (32-bit) from the

Start->All Programs-> STK Support Tools menu.)

Installing a Connector for a New MATLAB Version

1. Before installing a connector for a new MATLAB version,

check /matlab to confirm that the new version of MATLAB is supported

and a connector exists for that version.

2. Run the latest MATLAB Connector install to ensure that the updated connector is

available.

3. Install the new version of MATLAB.

4. To confirm that the installed version of MATLAB is connectable, start STK, go to the

Edit menu, and select Preferences->MATLAB.

5. Using the STK Preferences MATLAB page, you can only connect to the most

recent version of MATLAB installed. See Connecting to a Different Version of

MATLAB to change the version you are connected to.

6. If needed, click Refresh MATLAB Path to reset the MATLAB file path.

Connecting to a Different Version of MATLAB

If you have more than one version of MATLAB installed and you would like to connect to the

version installed prior to the last one installed, perform the following steps in MATLAB:

1. Run “matlab /regserver” from the command prompt, with administrator privileges,

from the bin folder of the version of MATLAB you want to use. You may need to use

the –c option to specify a different MATLAB license file if the administrator is not

licensed to run MATLAB.

2. Make sure you have the connectors installed for the version of MATLAB you want to

run.

3. Browse to the MATLAB_Connectors or MATLAB_Connectors_X64 folder on the STK

DVD, click on and follow the install instructions. (You can also download

the latest MATLAB Connector from /matlab.)

4. To confirm that the chosen version of MATLAB is connectable, start STK and go to the

Edit menu, and select Preferences->MATLAB.

5. If needed, click Refresh MATLAB Path to reset the MATLAB file path.

Uninstalling a MATLAB Version

If the uninstalled MATLAB version was registered as the automation server and you have

another version of MATLAB still installed on the computer where STK resides, follow the steps

in Connecting to a Different Version of MATLAB.

Troubleshooting the STK MATLAB Interface

Edit Menu->Preferences->MATLAB does not show an Installed Version of MATLAB

Check the following:

Run the MATLAB Connector Refresh utility by going to Edit

Menu->Preferences->MATLAB in STK and clicking Refresh MATLAB Path, or by

selecting Refresh MATLAB Path (32-bit) from the Start->All Programs-> STK

Support Tools menu.

If that does not enable the connector, check /matlab for the latest STK

MATLAB Connector install. If it is supported, download and follow the install

instructions. Start STK and check Edit Menu->Preferences->MATLAB. If it is not

supported, contact support@.

AGI MEX and/or MFiles are not found by MATLAB

If you alter the MATLAB search path and then save the change, the AGI MEX and MFiles may

be removed from the search path. To restore the MATLAB search path to include the AGI MEX

and MFiles, run the Connector Refresh utility.

Compatibility Issue with Multiple Versions of STK and/or MATLAB

Changes made to the system path enabling STK 9 and MATLAB to work together may cause

STK 10 to become incompatible with other versions of MATLAB. To correct this issue for STK

10, back out all changes made to the system path for the STK 9 and MATLAB interface.

Contact support@ if this does not solve your MATLAB compatibility issue.

Refresh MATLAB Path Tool Technical Notes

The Refresh MATLAB Path tool adds the default MATLAB user area, the location of the AGI

MEX files, and location of the AGI M-files to the AGI:defaultuserworkfolder preference. This

preference is overwritten each time you click Refresh MATLAB Path. If you override the

default user area provided by MATLAB, you must set the "AGI:userworkfolder" preference.

The AGI-provided startup.m file is automatically executed each time MATLAB starts. The

startup.m file extracts preferences configured by the Refresh MATLAB Path tool to add the

STK MEX file folders and user work folder to the path.

If you use your own startup.m file, you should rename your startup.m file and set the

'AGI:userstartup' preference to point to this renamed file.

After running the Refresh MATLAB Path tool, type 'help startup' from the MATLAB prompt to

show the options available.

Considerations for 64-bit MATLAB and 64-bit STK Engine 10

To run 64-bit MATLAB with AGI MEX files, you must install 64-bit STK Engine and confirm that

you have the 64-bit connector installed for the version of MATLAB that you want to run. If the

connector is not installed for that MATLAB version, /matlab for a list of

MATLAB versions supported by STK 10.

Valid STK-MATLAB Configurations

The following diagrams illustrate the valid configurations between STK and MATLAB.

STK/STK Engine and MATLAB Engine Configurations

STK/STK Engine and MATLAB Desktop Configurations

本文标签: 安装进行运行D盘目录