App designer table handling

조회 수: 9 (최근 30일)
Karol Lach
Karol Lach 2022년 9월 14일
답변: Christopher Stapels 2022년 9월 19일
Using windspeedexample, I created an app to read data from selected public Thingspeak channel and use it to plot.
I also wanted to add a table to store currently read records, which works, but has one significant problem - data in the table is getting rewritten in the first row. How do I make it so that every new input creates new row?
App is in the attachments in .mlapp form. Sorry for the language, it's in polish but every input is filled so you can see what is going on. If there is no data logging, change channel ID (upper input) to 12397, dropdown to position 2, time intervals (lower position) to 5.
  댓글 수: 1
Karol Lach
Karol Lach 2022년 9월 15일
Solved by creating isempty check and creating a loop with 2 tables.
tab = table(time,value,indexvalue);
if isempty(app.UITable.Data) == 1
app.UITable.Data = tab;
end
tab2 = [app.UITable.Data; tab];
app.UITable.Data = tab2;

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

답변 (1개)

Christopher Stapels
Christopher Stapels 2022년 9월 19일
Thanks for showing the result Karol. Im taking your solution and adding it to the answers to help others find it.
Solved by creating isempty check and creating a loop with 2 tables.
tab = table(time,value,indexvalue);
if isempty(app.UITable.Data) == 1
app.UITable.Data = tab;
end
tab2 = [app.UITable.Data; tab];
app.UITable.Data = tab2;

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by