|
previous: solve matrix next: fit polynomial |
The sample data files are
| v.dat | 25 numbers, in Fortran/C "E" notation |
|---|---|
| xy.dat | 30 lines, each with an x and a y value |
| m.dat | 45 numbers, several per line |
|
1. Read in & define array v with all (25) values
from the file v.dat 2. Read in & define arrays x and y with the 1st and 2nd columns (respectively) of file xy.dat 3. Read in & define 3×5 matrix M with the first 15 numbers in file m.dat |
| Mathematica: v = ReadList[ "v.dat", Number ]
xy = ReadList["xy.dat",{Number,Number}]; m = ReadList[ "m.dat", Table[Number,{5}], 3] |
Matlab: Use the "Import Wizard" (Import data from the File menu)   or v = load('v.dat');
xy = load('xy.dat');
fid = fopen('m.dat'); |
| Maple: xxx xxx xxx | IDL:
v = fltarr(25)
xy = fltarr(2,30)
m = fltarr(5,3)
|