Programming |
Lotus 123 Spreadsheets
See the wk1finfo
, wk1write
, and wk1read
reference pages for more detailed information and examples.
Getting Information About the File
Use the wk1finfo
function to determine if a file contains a Lotus WK1 spreadsheet:
'WK1'
if the file is a Lotus spreadsheet readable with the wk1read
function. Otherwise, it contains an empty string (''
).
'Lotus 123 Spreadsheet'
Example -- Querying a WK1 File. This example returns information about spreadsheet file matA.wk1
:
Exporting to the File
Use the wk1write
function to export a matrix to a Lotus spreadsheet file. You have the choice of positioning the matrix starting at the first row and column of the spreadsheet, or at any other location in the file.
To export to a specific location in the file, use the second syntax, indicating a zero-based starting row and column.
Example -- Writing to a WK1 File. This example exports an 8-by-8 matrix to spreadsheet file 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);
Importing from the File
To import data from the spreadsheet into the MATLAB workspace, use wk1read
. There are three ways to call wk1read
. The first two shown here are similar to wk1write
. The third enables you to select a range of values from the spreadsheet. You can specify the range
argument with a one-based vector, spreadsheet notation (e.g., 'A1..B7'
), or using a named range (e.g., 'Sales'
).
Example -- Reading from a WK1 File. Read in a limited block of the spreadsheet data by specifying 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
Working with Spreadsheets | Working with Scientific Data Formats |
© 1994-2005 The MathWorks, Inc.