The enviinfo function was used incorrectly, I don't know what went wrong.

조회 수: 2 (최근 30일)
宁 甘
宁 甘 2021년 9월 22일
댓글: 宁 甘 2021년 9월 22일
Wrong use of cell2struct, field name "Exposure(Ms)" is invalid.
I don't know what he means.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 9월 22일
It appears that the data file has a header that is Exposure (Ms) .
This is not a standard ENVI header, but MATLAB tries to put all of the headers from the file into the information structure.
In the current implementation, MATLAB tries to do that by using the names in the header as field names in a struct. However, Exposure (Ms) is not a valid MATLAB field name, and the process fails.
There is no option you can use to fix the problem; there is a mismatch between the expectation of the code (that all field names in the file with be valid MATLAB identifiers) and what you have in the file.
If you are willing to edit the Mathworks enviinfo code, you should be able to work around the problem.
In your version (R2021a) line 256 of the enviinfo.m file currently reads
otherwise
Immediately above that, insert these lines
case 'Exposure (Ms)'
key = 'Exposure_ms'; % Scalar numeric value
value = str2double(strtrim(split(value,',')));
... I am guessing here that the current field is not giving the exposure time in mega-seconds and that it is badly named ms (milli-seconds)
  댓글 수: 4
宁 甘
宁 甘 2021년 9월 22일
I removed the ms unit brackets based on the code you provided and it works, could it be that the bracket symbol is affecting the program.

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

카테고리

Help CenterFile Exchange에서 Display Point Clouds에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by