About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 5 years ago
  • Total downloads: 121
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Brett Shoelson (32 other programs)
See full specifications

scripts default iconreadfromexcel (Scripts) Publisher's description

Uses ActiveX commands to read range(s) from an existing Excel spreadsheet.


Uses ActiveX commands to read range(s) from an existing Excel spreadsheet.

FILELOC: Enter a string representing the (absolute or relative) location of an Excel file. (Extension may be omitted, and will be assumed to be .xls.)
Examples: 'c:brettmy archivestest1.xls'

SHEETNAME: (Optional): Any occurrence in the variable argument list of the strings 'sheetname' or 'sheet' prompts the function to change active sheets to the value in the following variable. That specifier must be a string argument matching exactly the name of an existing sheet in the opened file. If this argument is omitted, the function defaults to reading from the currently active sheet.

RANGE SPECIFIER(S): Enter the range(s) to read. The values stored in these ranges will be returned in consecutive output arguments.
Example: 'B1:B5'
'B1:B1' (or simply 'B1')
'B:B' or 'B'
(Entire second column)
'2:2' or '2'
(Entire second row)
'ALL' (Entire sheet)

(Additional ranges: Comma separated ranges in the same form as above; contents of archive will be returned in output arguments 2...n)

OUTPUT: If specified range is 1 cell, variable returned is of the same class as cell contents. If the range spans more than 1 cell, the variables will be cell arrays.

a = readfromexcel('c:brettmy archivestest1.xls','C1:C5');
reads from the currently active sheet

a = readfromexcel('c:brettmy archivestest1.xls', 'ALL');
reads the entire used portion of the active sheet

a = readfromexcel('c:brettmy archivestest1.xls', 'C');
reads column C of the used portion of the active sheet

[a,b] = readfromexcel('c:brettmy archivestest1.xls','sheet','sheet2','C1:C5','C1:P3');
reads from sheet2

[a,b,c] = readfromexcel('myarchive','C3:D5','sheet','mysheet','E4','sheet','sheet2','B3');
reads a from currently active sheet, switches to sheet 'mysheet' to read b, then to sheet 'sheet2' to read c.

Written by Brett Shoelson, Ph.D.
Update History:
1/04. Version 1.
2/2/04. Now allows multiple specifications of sheet name at the suggestion of R. Venkat), and support of relative paths (thanks to Urs Schwarz). Also, inclusion of the extension '.xls' is now superfluous.
7/29/04. Implements try/catch structure for reading of ranges to avoid errors that leave open activex connections. (Response to Chris Paterson's CSSM query). Also, now accomodates reading of entire sheet, or of entire row/column. (Response to email queries by Kinan Rai and CSSM query by Xiong.)

SEE ALSO: write2excel

System Requirements:

MATLAB 6.5 (R13)
Program Release Status: New Release
Program Install Support: Install and Uninstall

Is readfromexcel (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.