- Data not accumulating in table
- Zone number not being reset
- File deletion
How can I edit my app?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi! :)
Do I need a while loop somewhere?
Seems the values for the table osmotic data aren’t saved in my table columns when I run the app?
I think there is something missing in tester_app_3 which I can’t see.
Do I need a loop to accumulate the column values in osmotic data, I just get the last value printed. It also seems that the program doesn’t start on zone nr 1 when I start the app again though I have deleted the previous files by writing the syntax delete(file).
I have matlab 2018
I am not sending the functions that are needed to run the app and neither the other app required to run the app since they are many functions and the problem is in tester_app_3.
0 件のコメント
回答 (1 件)
Shubham
2024 年 10 月 9 日
Hi Muazma,
From what I gather, you are encountering the following issues in your app:
Addressing the first concern, the table "Osmotisk_data" is being overwritten in each iteration of loop. To accumulate data, append new rows to existing table rather than overwriting it.
if app.error_osm == 0
% Append new row to the table instead of overwriting
newRow = {app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1, app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet, app.Osmotic_pressure};
app.Osmotisk_data = [app.Osmotisk_data; newRow];
end
For your second and third issues, ensure that "app.zone_now" is initialized correctly when the app starts. It should start at 1 and increment with each iteration. For file deletion, ensure it is executed only once, preferably at the start of the app, to prevent unintended deletions
function startupFcn(app, app2)
app.Callingapp = app2;
app.zone_now = 1; % Initialize zone_now here
% Ensure the file is deleted at the start
if exist('Osmotic_data.xls', 'file') == 2
delete('Osmotic_data.xls');
end
end
Hope this helps.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!