Unable to load mat file data in Matlab App
조회 수: 4 (최근 30일)
이전 댓글 표시
In the App , I would like to ask the user to select the mat file path and load that file into workspace by pressing a push button. Below is the code and I don't why the mat file data is not getting loaded into the workspace. Secondly I also would like to plot the data in additional tabs. Could somebody help?
% Button pushed function: LoadButton_2
function LoadButton_2Pushed(app, event)
[app.file,app.path] = uigetfile('*.mat');
if isequal(app.file,0)
disp('User selected Cancel');
else
tempX =load(fullfile(app.path,app.file));
app.plotdata_2 =tempX;
disp(['User selected ', fullfile(app.path,app.file)]);
app.Logfile_2EditField.Value = app.file;
end
end
댓글 수: 0
채택된 답변
Cris LaPierre
2020년 12월 30일
편집: Cris LaPierre
2020년 12월 30일
The variables in your mat file are getting loaded into a structure. You have named this structure tempX. In order to access the data, you need to use the structure name and the variable name:
data = tempX.varName;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!