National Instruments 373392C-01 Manual do Utilizador Página 112

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 179
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 111
Chapter 5 Getting Started with Measurement Studio
Measurement Studio User Manual 5-8 ni.com
Generating, plotting, and analyzing the data
1. Double-click the button control to display the
Form1 code, with the
cursor inside the click event handler of the button control.
2. Add the following code to generate random data, plot the data,
calculate the mean of the data, and display the mean on the gauge.
[VB.NET]
' Declare and initialize an instance of WhiteNoiseSignal.
Dim whiteNoise As New WhiteNoiseSignal()
' Store the generated data in a double array named data.
Dim data As Double() = whiteNoise.Generate(1000.0, 256)
' Use the PlotY method to plot the data.
Plot.PlotY(data)
' Use the Mean method to calculate the mean of the data.
Dim mean As Double = Statistics.Mean(data)
' Display the mean on the gauge.
gauge.Value = mean
[C#]
// Declare and initialize an instance of WhiteNoiseSignal.
WhiteNoiseSignal whiteNoise = new WhiteNoiseSignal();
// Store the generated data in a double array named data.
double[] data = whiteNoise.Generate(1000.0, 256);
// Use the PlotY method to plot the data.
Plot.PlotY(data);
// Use the Mean method to calculate the mean of the data.
double mean = Statistics.Mean(data);
// Display the mean on the gauge.
gauge.Value = mean;
Vista de página 111
1 2 ... 107 108 109 110 111 112 113 114 115 116 117 ... 178 179

Comentários a estes Manuais

Sem comentários