Effacer les filtres
Effacer les filtres

How to plot table values?

1 vue (au cours des 30 derniers jours)
Dineth Senevirathne
Dineth Senevirathne le 11 Août 2017
Commenté : Walter Roberson le 11 Août 2017
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

Réponses (2)

Walter Roberson
Walter Roberson le 11 Août 2017
s = YourTable.signal_strength;
n = YourTable.hotspot_names;
x = ones(length(s), 1);
y = s(:);
scatter(x, y);
text(x, y, n);
  2 commentaires
Dineth Senevirathne
Dineth Senevirathne le 11 Août 2017
Modifié(e) : Dineth Senevirathne le 11 Août 2017
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 le 11 Août 2017
x = 1 : length(s);
y = s(:);
scatter(x, y);
set(gca, 'XTick', x, 'XTickLabel', n);

Connectez-vous pour commenter.


Akira Agata
Akira Agata le 11 Août 2017
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;

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by