I am trying to run a push button function that runs a code which calculates a value and then display the value in an edit field. This code worked in my first mlapp file but isnt working in this one. There is no error message but also no value.
% loads values from previous mlapp file.
load('temp.mat','Ps','Rtotal','Vs','Cstern','Tf','Ta','B','L','Cm','nabla','LCB','Abt','rho','d_BT','At','hb','Cwp','Screw','D','Z','Pc','ks','dv')
% Performs calculations...
VoyageEnergykWh=EnergyManeouvring+EnergyJourney; % Voyage Energy in kWh
VoyageEnergyJ=VoyageEnergykWh/(1000*60*60); % Voyage Energy in Joules
answer=VoyageEnergykWh;
answer2=VoyageEnergyJ;
app.kWhTextArea.Value=num2str(answer);
app.JoulesTextArea.Value=num2str(answer2);

댓글 수: 5

Walter Roberson
Walter Roberson 2020년 4월 18일
That would happen if either EnergyManeouvring or EnergyJourney were empty.
Kieran Graham
Kieran Graham 2020년 4월 18일
Hi Walter,
They both should have values as they are calculated from the values loaded in load(temp.mat)
Mehmed Saad
Mehmed Saad 2020년 4월 18일
put a break point at that line in appdesigner code view and see if answer has any value, if yes
then see if app.JoulesTextArea.Visible is on or off
Kieran Graham
Kieran Graham 2020년 4월 18일
Sorry for me being useless but would you be able to explain how to execute a break point in appdesigner
Mehmed Saad
Mehmed Saad 2020년 4월 18일
just remove the .zip from the end to make it capture-7.rar and then extract it there'll be a video inside it

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

질문:

2020년 4월 18일

댓글:

2020년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by