MATLAB BUILDER JA 2 Uživatelská příručka Strana 243

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 292
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 242
1 2 ... 238 239 240 241 242 243 244 245 246 247 248 ... 291 292

Komentáře k této Příručce

Žádné komentáře