How can extract data in scatter plot??
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MOzhdeh Salimi
le 24 Juil 2021
Commenté : MOzhdeh Salimi
le 24 Juil 2021
Hi all
I have two catgories of data that have between 0-1. I plotted these data in scatter form. Now I want to extract the range of data in the X-axis with length 0.01 and find Y value corresponding to x value.
please help me.
thanks.
2 commentaires
Scott MacKenzie
le 24 Juil 2021
What do you mean by I want to extract the range of data in the X-axis with length 0.01? A range has two values, not one.
Also, it would help if you post your data and code.
Réponse acceptée
Scott MacKenzie
le 24 Juil 2021
% test data
x = rand(1, 100);
y = rand(1, 100);
% find elements for class 1 (x is between 0 and 0.1)
idx = find(x >= 0 & x < 0.1);
xClass1 = x(idx);
yClass1 = y(idx);
% output data for 1st class (just for demo)
[xClass1' yClass1']
% repeat for other classes or setup in a loop
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Programming dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!