필터 지우기
필터 지우기

how to generate code from a .mat file data?

조회 수: 7 (최근 30일)
Bidyarani
Bidyarani 2023년 1월 22일
편집: Walter Roberson 2023년 1월 22일
i have a dataset in mat file and i want to view the data as in matlab code. how to generate the mat file into code script?
  댓글 수: 2
Rik
Rik 2023년 1월 22일
How exactly should the generating code be derived from the data? How can you tell that 2 is the result of 1+1 and not 4/2?
Sargondjani
Sargondjani 2023년 1월 22일
It is not clear what you want. you can simply open a .mat file, and you can view all variables in the matlab interface? What should the script do?

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

채택된 답변

Walter Roberson
Walter Roberson 2023년 1월 22일
편집: Walter Roberson 2023년 1월 22일
This is not possible in the general case. It is possible to have saved objects for which there is no public method to recreate the object (the internals of load methods are often not public)
For numeric matrices it is possible to write code to recreate the data, but the code might not be very legible. It might end up just looking like
output = reshape([long long long list of 25 digit numbers], [list of dimension sizes])
Arrays that are sufficiently large would have to be split over several files, as matlab only accepts about 128 megabytes per file now. https://www.mathworks.com/matlabcentral/answers/497231-error-file-is-too-large-for-matlab-to-run#answer_406914

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by