Why I can’t save my data in a .mat when using WebAppServer?
My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks!My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks! My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks! wepappserver MATLAB Answers — New Questions