Error: Unrecognized Variable Name
조회 수: 4 (최근 30일)
이전 댓글 표시
I'm trying to use strings read from an .xls as dataset variable names.
If I use them as imported and run the following code it works, although I get the information that they were modified by matlab to make them valid.
Dataset = set(Dataset,'VarNames',Names)
However, I need to manipulate them a bit. I.e. I need them to be in lower-case and without spaces. I therefore tried
Names = lower(Names);
Names = regexprep(Names, '[. ]','');
But when I run the code above after these manipulations (or only applying lower case) I get the following error:
??? Error using ==> dataset.subsref at 257
Unrecognized variable name 'Date'.
where 'Date' is the first string in Name. When checking by using
whos Name
in either case all the informations are the same except when removing the spaces memory size becomes obviously a little smaller.
So my question is what I did wrong that assigning the modified names doesn't work when it works with the unmodified ones?
Your help is very much appreciated!
댓글 수: 1
the cyclist
2012년 1월 9일
It would be easier to help you debug this if you supplied the briefest possible example of "Names" that gives the error, so that we could run your code and get the error more simply. Otherwise, we have a fair amount of guesswork to do.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!