MATLAB BUILDER JA 2 Podręcznik Użytkownika Strona 243

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 242
Spectral Analysis Example
The program does the following:
Constructs an input array with values representing a random signal
with two sinusoids at 15 and 40 Hz embedded inside of it
Creates an
MWNumericArray array that contains the data, as shown:
data = MWNumericArray.newInstance(dims, MWClassID.DOUBLE, MWComplexity.REAL);
Instantiates a fourier object
Calls the
plotfft method, w hich calls computeftt and plots the data
Uses a
try/catch block to handle exceptions
Frees native resources using
MWArray methods
7 Compile the powerspect.java application using javac.
a. Open a Command P rompt window and
cd to the
matlabroot\work\spectralanalysis directory.
b. On Windows, execute the fo llo wing command:
javac -classpath
.;
matlabroot\java\jar\toolbox\javabuilder.jar;
.\distrib\spectralanalysis.jar powerspect.java
c. On UNIX, execute the following command:
javac -classpath
.:
matlabroot/java/jar/toolbox/javabuilder.jar:
./distrib/spectralanalysis.jar powerspect.java
Note For matl abroot substitute the MATLAB root directory on your
system. Type
matlabroot to see this directory name.
8 Run the application
On Windows, execute the
powerspect class file as follows:
java -classpath
5-13
Przeglądanie stron 242
1 2 ... 238 239 240 241 242 243 244 245 246 247 248 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag