フィルターのクリア

Error: Unrecognized Variable Name

3 ビュー (過去 30 日間)
Patrick Saegesser
Patrick Saegesser 2012 年 1 月 9 日
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
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 ExchangeData Import from MATLAB についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by