I am having trouble reading textfile data into my app using uigetfile and readtable functions in appdesigner. Kindly assist

조회 수: 4 (최근 30일)
I am using a pushbutton.userdata option to read the textfiles and i am not sure if thats the right way to do it. Once the data is read in the dialogbox app. it should be passeed to the main app to complete calculations using ode45 integration.
[The data provided is daily for 365days, kindly run the model from the 1st,JAN,2023 to 31st,DEC,2023] i.e choose the start date as January, 1st, 2023 and end date as December, 31st, 2023 under the simulation tab.
I am encountering the following errors when i push the Runmodel button under the simulation tab.
Error while evaluating Button PrivateButtonPushedFcn.
Warning: Failure at t=4.400000e+01. Unable to meet integration tolerances without reducing the step size below the smallest value
allowed (1.136868e-13) at time t.
> In ode45 (line 662)
In IAA_1/RunModelButtonPushed (line 249)
In matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
Attched are the apps and the CWR data (CWR.txt), Rainfalldata(PCP.txt), Wind_data(WND.txt), Humidity_data(HMD.txt), Temperature_data(TMP.txt), Daylighthours(DLH.txt)
Moreover, when i try to write the data i have read, there seems to be mixup. Like CRW data contains TMP data and vice versa. Kindly assist.

채택된 답변

Voss
Voss 2024년 4월 14일
All of the IAA_1 app's properties that are passed to the second app (T_wout, T_win, Sr, etc.) are initially empty [].
You can either initialize them to non-empty values, e.g., in IAA_1, where they are defined as app properties:
properties (Access = private)
Dialogapp1
T_wout = 27
T_win = 27
Sr = 2
% etc.
Or you can check whether they're empty in the startupFcn of WATER_TMP_Dialogbox_1, and only update the components corresponding to non-empty values:
if ~isempty(T_wout)
app.T_woutEditField.Value=T_wout;
end
if ~isempty(T_win)
app.T_winEditField.Value=T_win;
end
if ~isempty(Sr)
app.srEditField.Value = Sr;
end
% etc.
Or you can do both of those things.
  댓글 수: 2
Daniel
Daniel 2024년 4월 15일
이동: Voss 2024년 4월 16일
Thank you so much for your response. How about the 'Warning: Failure at t=4.400000e+01. Unable to meet integration tolerances without reducing the step size below the smallest value
allowed (1.136868e-13) at time t.
> In ode45 (line 662)'

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by