STK Components for Java 2022 r2

## Using STK Components with Matlab |

The Mathworks product MATLAB supports using Jar files as an external interface. This means that STK Components can be used from within the MATLAB environment. Help from Mathworks is located on their site here.

This topic will show you how to setup and use STK Components with MATLAB to perform some simple analysis.

Prerequisites

You must have the following prerequisites met to integrate STK Components with MATLAB:

STK Components, Release 2009r3 or later

A valid STK Components license

Mathwork's MATLAB product, version R2009a or later installed

Sample MATLAB files located in the

*Examples\MATLAB*directory of the STK Components install

Tutorial

This section will show you how to set up MATLAB using STK Components and the sample files provided with the STK Components Install.

Start MATLAB.

Within MATLAB, change directories to the MATLAB directory in your STK Components install:

*Examples\Matlab*Open the LoadComponents.m file in the MATLAB editor.

Open your STK Components License file in any text editor (the MATLAB editor will work fine here too).

In the LoadComponents.m file, update the MATLAB string with your license information. Note that the MATLAB string containing your license must be an exact match to the license file you received from AGI, including all XML elements.

Save the LoadComponents.m file.

Open the RunComponentDemo.m file in the MATLAB Editor.

This file runs all the demos, after first loading the components libraries. You can run this file to execute all the demos at once, or can also step through each file using the Matlab debugger, seeing what each line does.

STK Components MATLAB Example Files

RunComponentDemo.m - Loads each file in order, running the entire demo.

LoadComponents.m - Loads STK Components into MATLAB, and activates the license. You can clear the imported Java classes using the clear java MATLAB command.

NavigationExample.m - Example STK Components code that sets up and runs the navigation examples, using the

**Navigation Accuracy Library**. The example calculates Dilution of Precision (DOP), and assessed and predicted navigation accuracy for a single site. If you don't have a license for the**Navigation Accuracy Library**, simply comment out the NavigationExample line in the RunComponentDemo.m file.DGLExample.m - This file contains example DGL code that creates an SGP4 propagator from a TLE, and a facility. It then calculates access over a three day period from that facility to the satellite using an ElevationAngleConstraint. The access times are then output to the MATLAB Command Window.