Matlab GUI Table and Arduino

6 ビュー (過去 30 日間)
asdf asdf
asdf asdf 2015 年 9 月 15 日
コメント済み: Walter Roberson 2015 年 9 月 15 日
How will I create a table in Matlab gui that continuously takes various sensor data from Arduino? On one column I want it to be the time.

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 9 月 15 日
You cannot do that. Instead you have to write code that builds a new numeric matrix or cell array, and set()'s that as the Data property of the table.
For example you could loop and get sensor information and the every 20th update, appends the sensor data to the bottom of a cell array, and then set() the cell array as the Data property.
  2 件のコメント
asdf asdf
asdf asdf 2015 年 9 月 15 日
Could you please give an example?
Walter Roberson
Walter Roberson 2015 年 9 月 15 日
subset_size = 20;
num_channel = 3;
complete_data_table = {};
while true
subset_data = zeros(subset_size, num_channels)
for K = 1 : subset_size
subset_data(:,K) = get data from arduino
end
subset_table = num2cell(subset_data);
complete_data_table = vertcat(complete_data_table,subset_table);
set(HandleOfUitable, 'Data', complete_data_table);
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by