필터 지우기
필터 지우기

How to select one column value and the values associated in that row and plot

조회 수: 2 (최근 30일)
Hi everyone,
I have a table with 1416 rows and 5 coulmns. So, for every time instant 0.5 - 29.5 I have the Node C1, C2, C3 and so on.. I want to get the data specific to C1 and time instants,cachehits and cachemisses, cachehitratio associated with it and plot a graph between Time and CacheHitRatio.

채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 12일
mask = ismember(YourTable.Node, 'C1');
subsetC1 = YourTable(mask, :);
  댓글 수: 2
Sai Gautam Mandapati
Sai Gautam Mandapati 2022년 8월 12일
편집: Sai Gautam Mandapati 2022년 8월 13일
Thank you so much! Based on your code I was able to generate the tables for C1, C2, C3,... So, now I want to plot all the tables Time vs CacheHitRatio in one graph. How can I do that? @Walter Roberson
Walter Roberson
Walter Roberson 2022년 8월 15일
uniq_node = unique(YourTable.Node);
num_uniq = length(uniq_node);
subsets = cell(num_uniq, 1);
for K = 1 : num_uniq
this_node = uniq_node{K};
mask = ismember(YourTable.Node, this_node);
subsets{K} = YourTable(mask, :);
end
for K = 1 : num_uniq
this_subset = subsets{K};
plot(this_subset.Time, this_subset.CacheHitRatio, 'DisplayName', uniq_node{K});
hold on
end
hold off
xlim auto; ylim auto
legend show

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-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