How to plot table values?

5 ビュー (過去 30 日間)
Dineth Senevirathne
Dineth Senevirathne 2017 年 8 月 11 日
コメント済み: Walter Roberson 2017 年 8 月 11 日
hello i have a table with 2 columns.
1. numeric values (some wifi signal strength values)
2. Names (wifi hotspot names)
i want to plot name vs signal level

回答 (2 件)

Walter Roberson
Walter Roberson 2017 年 8 月 11 日
s = YourTable.signal_strength;
n = YourTable.hotspot_names;
x = ones(length(s), 1);
y = s(:);
scatter(x, y);
text(x, y, n);
  2 件のコメント
Dineth Senevirathne
Dineth Senevirathne 2017 年 8 月 11 日
編集済み: Dineth Senevirathne 2017 年 8 月 11 日
hello sir thank you for your answer.
but it gives me a graph like below, but i want hotspot names on x axis and signal strengths on y axis
Walter Roberson
Walter Roberson 2017 年 8 月 11 日
x = 1 : length(s);
y = s(:);
scatter(x, y);
set(gca, 'XTick', x, 'XTickLabel', n);

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


Akira Agata
Akira Agata 2017 年 8 月 11 日
How about using bar chart, like:
% Sample data
YourTable = table({'hotspot1';'hotspot2';'hotspot3'},[10;20;30],...
'VariableNames',{'Name','Value'});
bar(YourTable.Value);
ax = gca;
ax.XTickLabel = YourTable.Name;

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by