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

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 292
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 248
Matrix Math Example
getfactor. ja va
/* getfactor.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 factormatrix.*;
/*
* getfactor class computes cholesky, LU, and QR
* factorizations of a finite difference matrix
* of order N. The value of N is passed on the
* command line. If a second command line arg
* is passed with the value of "sparse", then
* a sparse matrix is used.
*/
class getfactor
{
public static void main(String[] args)
{
MWNumericArray a = null; /* Stores matrix to factor */
Object[] result = null; /* Stores the result */
factor theFactor = null; /* Stores factor class instance */
try
{
/* If no input, exit */
if (args.length == 0)
{
System.out.println("Error: must input a positive integer");
return;
}
/* Convert input value */
int n = Integer.valueOf(args[0]).intValue();
5-19
Przeglądanie stron 248
1 2 ... 244 245 246 247 248 249 250 251 252 253 254 ... 291 292

Komentarze do niniejszej Instrukcji

Brak uwag