MATLAB Function Reference |
Read Lotus123 spreadsheet file (.wk1
)
Syntax
Description
M = wk1read(filename)
reads a Lotus123 WK1 spreadsheet file into the matrix M
.
M = wk1read(filename,r,c)
starts reading at the row-column cell offset specified by (r,c)
. r
and c
are zero based so that r=0
, c=0
specifies the first value in the file.
M = wk1read(filename,r,c,range)
reads the range of values specified by the parameter range
, where range
can be
'A1...C5'
'Sales'
Examples
Create a 8-by-8 matrix A
and export it to Lotus spreadsheet matA.wk1
:
A = [1:8; 11:18; 21:28; 31:38; 41:48; 51:58; 61:68; 71:78] A = 1 2 3 4 5 6 7 8 11 12 13 14 15 16 17 18 21 22 23 24 25 26 27 28 31 32 33 34 35 36 37 38 41 42 43 44 45 46 47 48 51 52 53 54 55 56 57 58 61 62 63 64 65 66 67 68 71 72 73 74 75 76 77 78 wk1write('matA.wk1', A);
To read in a limited block of the spreadsheet data, specify the upper left row and column of the block using zero-based indexing:
M = wk1read('matA.wk1', 3, 2) M = 33 34 35 36 37 38 43 44 45 46 47 48 53 54 55 56 57 58 63 64 65 66 67 68 73 74 75 76 77 78
To select a more restricted block of data, you can specify both the upper left and lower right corners of the block you want imported. Read in a range of values from row 4, column 3 (defining the upper left corner) to row 6, column 6 (defining the lower right corner). Note that, unlike the second and third arguments, the range argument [4 3 6 6]
is one-based:
See Also
wk1finfo | wk1write |
© 1994-2005 The MathWorks, Inc.