필터 지우기
필터 지우기

How to plot table values?

조회 수: 1 (최근 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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by