필터 지우기
필터 지우기

Load .mat-file in Web App Server

조회 수: 14 (최근 30일)
Dominik Müller
Dominik Müller 2020년 10월 30일
편집: Mario Malic 2020년 10월 30일
Hi folks,
I have an App running on Web App Server. What I'm trying to do is read in a .mat-file and set some values depending on the file.
My aim is to get to a point where a user can make some changes on the GUI/app then save the entered values to a custom .mat-file and load them back into the app to a later point in time. I hope my problem is okay to understand.
If I run my App out of Matlab save/load works fine. But on the deployed app on the server it doesn't.
I get the following messages in the log of the server:
% saveload.mat is uploaded successfully
% Error using load
% Unable to read file 'saveload.mat'. No such file or directory.
What am I doing wrong?
  댓글 수: 5
Dominik Müller
Dominik Müller 2020년 10월 30일
Thank you Mario, you led me to the right direction. Problem's solved now.
Mario Malic
Mario Malic 2020년 10월 30일
편집: Mario Malic 2020년 10월 30일
Great! Also, don't use cd, rather supply full or relative path to load function. It is slow and can cause issues.

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

채택된 답변

Dominik Müller
Dominik Müller 2020년 10월 30일
The solution is quite simple:
[file,path] = uigetfile('*.mat'); % see matlab documentation of uigetfile
cd(path)
data = load(file);

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by