VibrationMaster 发表于 2011-8-19 06:08

Data Range Is Invalid

MATLAB版本2010b
用xlsread读指定sheet时发生"Data Range Is Invalid",但是如果不指定"sheet",按缺省方式读第一个sheet, 工作正常
这是为什么呢?

ChaChing 发表于 2011-8-19 14:55

回复 1 # VibrationMaster 的帖子

LZ下的cmd为何!?
help(2009a)中有此段说明, 请留意下
Note   If you specify only two inputs, xlsread must decide whether the second input refers to a sheet or a range. To specify a range (even a range of a single cell), include a colon character in the input string (e.g., 'D2:H4'). If you do not include a colon character (e.g., 'sales' or 'D2'), xlsread interprets the second input as the name or index of a worksheet.
不过这种错用与LZ描述的刚好相反!?

VibrationMaster 发表于 2011-8-19 17:47

回复 2 # ChaChing 的帖子

1.sheet 指定有两种方法,一种是数字1,2,3,4...,另一种按名称. 前一种指定方法,我不会犯错;第二种方法,我是按xlsinfo返回的sheet名称执行的.
2. 二者均出错
3. 我在google上搜了一通,有些人出现了同样的错误,但是都没有合理的解释

ChaChing 发表于 2011-8-22 00:47

回复 3 # VibrationMaster 的帖子

先前很少使用此函数!
特别看了下help, 并试了下, 并无LZ说的这种现象!
只是我的版本较旧些(2009b), 或许造成无法复製LZ的问题, 只是不解旧版都不问题, 新版会出错!?
我也google过了, 同样没有找到合理的答应!
同静待高人路过了
页: [1]
查看完整版本: Data Range Is Invalid