MATLAB BUILDER JA 2 Guia do Utilizador Página 241

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 292
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 240
Spectral Analysis Example
6 W rite source code for an application that accesses the component.
The sample application for this example is in
SpectraExample\SpectraDemoJavaApp\powerspect.java.
The program listing is shown here.
powerspect.java
/* powerspect.java
* This file is used as an example for the MATLAB
* Builder for Java product.
*
* Copyright 2001-2006 The MathWorks, Inc.
*/
/* Necessary package imports */
import com.mathworks.toolbox.javabuilder.*;
import spectralanalysis.*;
/*
* powerspect class computes and plots the power
* spectral density of an input signal.
*/
class powerspect
{
public static void main(String[] args)
{
double interval = 0.01; /* Sampling interval */
int nSamples = 1001; /* Number of samples */
MWNumericArray data = null; /* Stores input data */
Object[] result = null; /* Stores result */
fourier theFourier = null; /* Fourier class instance */
try
{
/*
* Construct input data as sin(2*PI*15*t) +
* sin(2*PI*40*t) plus a random signal.
* Duration = 10
5-11
Vista de página 240
1 2 ... 236 237 238 239 240 241 242 243 244 245 246 ... 291 292

Comentários a estes Manuais

Sem comentários