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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 234
Plot Example
x.set(i, i);
y.set(i, i*i);
}
/* Create new plotter object */
thePlot = new plotter();
/* Plot data */
thePlot.drawplot(x, y);
}
catch (Exception e)
{
System.out.println("Exception:"+e.toString());
}
finally
{
/* Free native resources */
MWArray.disposeArray(x);
MWArray.disposeArray(y);
if (thePlot != null)
thePlot.dispose();
}
}
}
The program does the following:
Creates two arrays of double values, using
MWNumericArray to represent
thedataneededtoplottheequation.
Instantiates the
plotter clas s as thePlot object, as shown:
thePlot = new plotter();
Calls the drawplot method to plot the e quation using the M ATLAB
plot function, as shown:
thePlot.drawplot(x,y);
5-5
Przeglądanie stron 234
1 2 ... 230 231 232 233 234 235 236 237 238 239 240 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag