I nead help, xlsread(file,-1).
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
from doc:
[num,txt,raw] = xlsread(filename,-1) opens an Excel window to interactively select data. Select the worksheet, drag and drop the mouse over the desired range, and click OK.
How can I save this selected area (ex ‘A3:AB187’ or other) to use as a variable.I wont read in the same area (ex ‘A3:AB187’ or other) with multiple files.
Thanks,
Jola
3 comentarios
Respuesta aceptada
Oleg Komarov
el 1 de Ag. de 2012
I'll rephrase the question to make it clear.
How can I return the address of the data which I selected interactively with:
xlsread(filename,-1)
After a bit of reverse engineering I found a semi-undocumented feature. It is possible to play with the COM object through the 5th input. The syntax I am gonna use is:
[num,txt,raw,custom] = xlsread(filename,sheet,range,'',functionHandle)
Step 1 Create the following function which will query the Address property
function [DataRange, range] = customOut(DataRange)
range = DataRange.Address;
end
Step 2 Now simply import the data with:
[num,txt,raw,address] = xlsread('test.xlsx',-1,[],[],@customOut)
address =
$B$7:$D$12
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!