필터 지우기
필터 지우기

.mat file contains same variable names

조회 수: 1 (최근 30일)
David
David 2015년 1월 16일
댓글: Image Analyst 2015년 1월 20일
Hi dear Matlab community,
I have a question concerning the import of a .mat - file which contains variables of the same name. When I try to import the file, only one array will be imported because it has the same name as the following ones (see picture below). Is there a way to import all of the arrays and give them different names while importing?
Thanks for your help,
David
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2015년 1월 19일
David - I didn't realize it was possible to save a variable with the same name more than once to a mat file. Are you sure that all these variables have the same name, or does the above just show the truncated names of the variables (due to space limitation)? It would be interesting to know the code that you were using that allowed you to do this.
David
David 2015년 1월 19일
Yeah I was also wondering. Actually I can´t give you any code because a program converted a CAN - Measuring to this .mat format. And yes all these variables have got the same names for sure. Any idea how I could load this whole .mat file into MATLAB?

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

답변 (1개)

Image Analyst
Image Analyst 2015년 1월 19일
Did you create the mat file with the -append option? From the help for save():
save(filename,variables,'-append') adds new variables to an existing file, and does not overwrite it.
Perhaps that is how you got multiple copies of the variable in there.
  댓글 수: 4
David
David 2015년 1월 20일
It shows the same as on the right column in the workspace. I have only on variable for each value but not multiple ones.
Image Analyst
Image Analyst 2015년 1월 20일
Then where did you get that screenshot that showed that there were multiple versions of the variable?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by