Issues using 'readtable' (MATLAB 2024a)
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
The following code had worked in the past to read Excel files as tables in MATLAB.
elec_list = readtable('/Users/.../preprocessed_data/databases/elec_list.xlsx', 'Sheet','main');
Recently, the same code doesn't work (no paths or filenames have been changed) and yields the following error:
Error using ones
Size inputs must be scalar.
Error in any (line 65)
sz = [sz,ones(1,DIM-length(sz))];
Error in readtable (line 501)
if any(cellfun(@(arg) isa(arg,"matlab.io.ImportOptions"),varargin),'all')
A few things I tried:
- Running the code in MATLAB 2023b and MATLAB 2024a
- Testing which version I am using:
which readtable
/Applications/MATLAB_R2024a.app/toolbox/matlab/iofun/readtable.m
3. Using the MATLAB interactive environment I try loading the data but it says it contains uninterpretable data.

I checked the Excel file and it is not corrupted. I tried created the file from de novo and then copying the data making sure nothing was weird. This didn't work.
Thank you for your help.
채택된 답변
Steven Lord
2024년 9월 3일
Let's check that you haven't accidentally defined a length.m function that does not behave the same way as the one included in MATLAB. What does this display?
which -all length
built-in (/MATLAB/toolbox/matlab/elmat/length)
built-in (/MATLAB/toolbox/matlab/elmat/@double/length) % double method
built-in (/MATLAB/toolbox/matlab/elmat/@int16/length) % int16 method
built-in (/MATLAB/toolbox/matlab/elmat/@int32/length) % int32 method
built-in (/MATLAB/toolbox/matlab/elmat/@int64/length) % int64 method
built-in (/MATLAB/toolbox/matlab/elmat/@int8/length) % int8 method
built-in (/MATLAB/toolbox/matlab/elmat/@logical/length) % logical method
built-in (/MATLAB/toolbox/matlab/elmat/@single/length) % single method
built-in (/MATLAB/toolbox/matlab/elmat/@uint16/length) % uint16 method
built-in (/MATLAB/toolbox/matlab/elmat/@uint32/length) % uint32 method
built-in (/MATLAB/toolbox/matlab/elmat/@uint64/length) % uint64 method
built-in (/MATLAB/toolbox/matlab/elmat/@uint8/length) % uint8 method
length is a built-in method % string method
/MATLAB/toolbox/matlab/lang/+matlab/+mixin/@Scalar/Scalar.m % dictionary method
/MATLAB/toolbox/matlab/datatypes/categorical/@categorical/length.m % categorical method
/MATLAB/toolbox/matlab/graphfun/@digraph/digraph.m % digraph method
/MATLAB/toolbox/matlab/graphfun/@graph/graph.m % graph method
/MATLAB/toolbox/matlab/datatypes/tabular/@tabular/tabular.m % tabular method
/MATLAB/toolbox/matlab/datatypes/datetime/@datetime/datetime.m % datetime method
/MATLAB/toolbox/matlab/datatypes/duration/@duration/duration.m % duration method
length is a built-in method % matlab.internal.capability.Capability method
length is a built-in method % connector.internal.LoggerLevel method
length is a built-in method % matlab.lang.OnOffSwitchState method
/MATLAB/toolbox/matlab/indexing/+matlab/+mixin/+indexing/@RedefinesParen/length.m % matlab.mixin.indexing.RedefinesParen method
length is a built-in method % containers.Map method
length is a built-in method % matlab.internal.reference.property.RefEntityType method
length is a built-in method % matlab.internal.reference.api.EntityPrecision method
length is a built-in method % matlab.internal.reference.property.DeprecationStatus method
length is a built-in method % matlab.internal.reference.property.FunctionType method
length is a built-in method % matlab.internal.reference.property.SyntaxType method
length is a built-in method % matlab.internal.reference.api.EntityCaseSensitivity method
length is a built-in method % simulink.FindSystemTask.Status method
length is a built-in method % mf.zero.meta.Language method
length is a built-in method % dig.config.CommandType method
length is a built-in method % dig.config.HorizontalAlignment method
length is a built-in method % dig.config.ResourceState method
length is a built-in method % dig.config.ResourceType method
length is a built-in method % dig.model.DisplayState method
length is a built-in method % dig.model.EventDataType method
length is a built-in method % dig.model.FunctionType method
length is a built-in method % dig.model.ValidInBdType method
length is a built-in method % dig.model.ViewMode method
length is a built-in method % matlab.unittest.internal.fixtures.FolderScope method
length is a built-in method % matlab.automation.Verbosity method
length is a Java method % java.io.File method
length is a Java method % java.lang.String method
length is a Java method % java.lang.CharSequence method
length is a built-in method % matlab.internal.timer.CallBackTypeEnum method
length is a built-in method % matlab.internal.timer.BusyModeEnum method
length is a built-in method % matlab.internal.timer.ExecutionModeEnum method
/MATLAB/toolbox/matlab/bigdata/@tall/length.m % tall method
built-in % gpuArray method
/MATLAB/toolbox/matlab/serial/@serial/length.m % serial method
/MATLAB/toolbox/matlab/timeseries/@tscollection/length.m % tscollection method
/MATLAB/toolbox/icomm/opc/opc/@opcroot/length.m % opcroot method
/MATLAB/toolbox/imaq/imaq/@videoinput/length.m % videoinput method
/MATLAB/toolbox/instrument/instrument/@udp/length.m % udp method
/MATLAB/toolbox/instrument/instrument/@icgroup/length.m % icgroup method
/MATLAB/toolbox/instrument/instrument/@icdevice/length.m % icdevice method
/MATLAB/toolbox/instrument/instrument/@tcpip/length.m % tcpip method
/MATLAB/toolbox/instrument/instrument/@Bluetooth/length.m % Bluetooth method
/MATLAB/toolbox/instrument/instrument/@gpib/length.m % gpib method
/MATLAB/toolbox/instrument/instrument/@visa/length.m % visa method
/MATLAB/toolbox/instrument/instrument/@i2c/length.m % i2c method
/MATLAB/toolbox/parallel/array/distributed/@codistributed/length.m % codistributed method
/MATLAB/toolbox/parallel/array/distributed/@distributed/length.m % distributed method
/MATLAB/toolbox/parallel/gpu/gpu/@gpuArray/length.m % gpuArray method
/MATLAB/toolbox/parallel/lang/@Composite/length.m % Composite method
/MATLAB/toolbox/robust/rctobsolete/robust/@icsignal/length.m % icsignal method
/MATLAB/toolbox/shared/statslib/@dataset/length.m % dataset method
댓글 수: 1
Comparing our outputs, I have a few extra ones coming from toolboxes (MATLAB native and extra ones).
I tried the logical step:
restoredefaultpath
After doing this, my readtable function works. This makes suspect that the eeglab "length.m" functions is the one causing the issues. How should I deal with this issue? Renaming the function from the toolbox (which seems a bit problematic) or what else?
>> which -all length #before doing restoredefaultpath
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/length)
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@double/length) % double method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@int16/length) % int16 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@int32/length) % int32 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@int64/length) % int64 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@int8/length) % int8 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@logical/length) % logical method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@single/length) % single method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@uint16/length) % uint16 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@uint32/length) % uint32 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@uint64/length) % uint64 method
built-in (/Applications/MATLAB_R2024a.app/toolbox/matlab/elmat/@uint8/length) % uint8 method
length is a built-in method % string method
length is a built-in method % matlab.lang.internal.FunctionInvocationType method
length is a built-in method % matlab.internal.capability.Capability method
length is a Java method % java.io.File method
length is a built-in method % connector.internal.LoggerLevel method
length is a Java method % java.lang.String method
length is a Java method % java.lang.CharSequence method
length is a built-in method % containers.Map method
length is a built-in method % matlab.desktop.editor.RtcEditorState method
length is a built-in method % matlab.lang.OnOffSwitchState method
/Users/camilocastelblanco/Dartmouth College Dropbox/Camilo Castelblanco Riveros/ieeg-mimetic/analysis_scripts/main/matlab_scripts/matlab_toolboxes/eeglab2023.0/functions/@mmo/length.m % mmo method
/Users/camilocastelblanco/Dartmouth College Dropbox/Camilo Castelblanco Riveros/ieeg-mimetic/analysis_scripts/main/matlab_scripts/matlab_toolboxes/eeglab2023.0/functions/@memmapdata/length.m % memmapdata method
/Users/camilocastelblanco/Dartmouth College Dropbox/Camilo Castelblanco Riveros/ieeg-mimetic/analysis_scripts/main/matlab_scripts/matlab_toolboxes/eeglab2023.0/functions/@eegobj/length.m % eegobj method
/Applications/MATLAB_R2024a.app/toolbox/matlab/bigdata/@tall/length.m % tall method
/Applications/MATLAB_R2024a.app/toolbox/matlab/serial/@serial/length.m % serial method
built-in % gpuArray method
/Applications/MATLAB_R2024a.app/toolbox/matlab/datatypes/categorical/@categorical/length.m % categorical method
/Applications/MATLAB_R2024a.app/toolbox/matlab/timeseries/@tscollection/length.m % tscollection method
/Applications/MATLAB_R2024a.app/toolbox/parallel/lang/@Composite/length.m % Composite method
/Applications/MATLAB_R2024a.app/toolbox/parallel/array/distributed/@codistributed/length.m % codistributed method
/Applications/MATLAB_R2024a.app/toolbox/parallel/array/distributed/@distributed/length.m % distributed method
/Applications/MATLAB_R2024a.app/toolbox/parallel/gpu/gpu/@gpuArray/length.m % gpuArray method
/Applications/MATLAB_R2024a.app/toolbox/shared/statslib/@dataset/length.m % dataset method
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
태그
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
