App designer table handling

10 visualizaciones (últimos 30 días)
Karol Lach
Karol Lach el 14 de Sept. de 2022
Respondida: Christopher Stapels el 19 de Sept. de 2022
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 comentario
Karol Lach
Karol Lach el 15 de Sept. de 2022
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;

Iniciar sesión para comentar.

Respuestas (1)

Christopher Stapels
Christopher Stapels el 19 de Sept. de 2022
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;

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre ThingSpeak en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by