how to extract a part of a table using logical indexing and plot a scatter figure
21 次查看(过去 30 天)
显示 更早的评论
Hello everybody
I already ask a similar question and didn't get any answer. I am going to ask it in a different manner, hope to get some advice.
I have the duration_time.xlsx file.
I need to group he information inside it and plot with different mark and colors.
like
all the dips of 90 must be blue
all the dips of 60 must be red
all the dips of 45 must be green
types which end to "_s" must be circle
types with no "_s" must be star
I think I should make new tables and then use "hold on" to impose all on one figure.
how can I pick all the rows that their first colmn is "90"
T = readtable('duration_time.xlsx',...
'Range','A1:N16',...
'ReadVariableNames',true)
A=T.dip==90;
....
I would appreciate any help.
0 个评论
回答(1 个)
Mohammad Sami
2019-11-1
编辑:Mohammad Sami
2019-11-1
You are on the right track. You just need to use the indexing as normal.
You can check the plot documentation for the color, marker style e.t.c.
idx_90 = T.dip == 90;
T90 = T(idx_90,:);
f = figure;
hold on;
plot(T90.abc,T90.xyz) % use the variables you want to plot, specify the color and marker, check doc plot
% the rest of your indexing and plots.....
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!