unstack warnings about variable names

조회 수: 8 (최근 30일)
alpedhuez
alpedhuez 2020년 7월 5일
댓글: dpb 2020년 7월 6일
I ran
unstack
and got
Warning: Table variable names that were not valid MATLAB identifiers have been modified. Since table variable names must be unique, any table variable names that happened to match the new identifiers also have been modified.
To use the original INDVAR values as table variable names, set 'VariableNamingRule' to 'preserve'.
What does it mean?

채택된 답변

dpb
dpb 2020년 7월 5일
편집: dpb 2020년 7월 6일
Just what is says... :)
Your table (or timetable) contained data values that were not valid to be used as MATLAB variable names (that means NOT beginning w/ number, having embedded blanks, etc., etc.,...) Prior to R2019b (I believe was the introduction) table variable names had to follow same rules as "real" variables.
You either must upgrade to get the new functionality or accept the modified names or change them to something you like better than the machine-generated ones.
Also, if there are duplicated values, that's a no-no -- cannot have two columns with the same variable name--and that rule hasn't gone away and can't go away.
Since we don't have a klew what your data looked like, that's about the best we can do on specifics...
  댓글 수: 2
alpedhuez
alpedhuez 2020년 7월 6일
"A valid variable name starts with a letter, followed by letters, digits, or underscores."
dpb
dpb 2020년 7월 6일
Yes, I see I mistyped what I intended above -- leaving out the "NOT" in front of "beginning w/" which definitely changes the meaning and is, of course, wrong besides. Didn't notice that until just now--made the correction.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 7월 5일
Using your table's name, what does this say if you stop there and type this into the command window.
yourTableName.Properties.VariableNames
It should spit your table's columns names to the command window. What does it say?
Attach your table in a .mat file if you need more help.

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by