Illustration of Spreadsheet Files:
This reads the numbers in a double vector variable nums and the text in a cell array txt (the xlsread function forever returns the numbers first and later text). The cell array is 4 × 3. It consist three columns as the file had three columns, but as the middle column had numbers (that were extracted and stored in the nums vector), at middle column in the cell array txt consists of the empty strings.
>> txt{1,2}
ans =
''
>> txt{1,3}
ans =
Cindy
A loop can then be used to echo-print the values from the spreadsheet in the original format:
>> for i = 1:length(nums)
fprintf('%c %d %s\n', txt{i,1}, ...
nums(i), txt{i,3})
end
a 123 Cindy
b 333 Suzanne
c 432 David
d 987 Burt