フィルターのクリア

How can extract data in scatter plot??

5 ビュー (過去 30 日間)
MOzhdeh Salimi
MOzhdeh Salimi 2021 年 7 月 24 日
コメント済み: MOzhdeh Salimi 2021 年 7 月 24 日
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 件のコメント
Scott MacKenzie
Scott MacKenzie 2021 年 7 月 24 日
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.
MOzhdeh Salimi
MOzhdeh Salimi 2021 年 7 月 24 日
Yes, i want to classification my data to classes with 0.01 length. For example: Class1: 0-0.0.1 Class2:0.0.1-0.0.2 . . . And then find corresponding y value to these class.

サインインしてコメントする。

採用された回答

Scott MacKenzie
Scott MacKenzie 2021 年 7 月 24 日
% 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']
ans = 7×2
0.0656 0.9182 0.0330 0.5282 0.0287 0.0501 0.0358 0.3897 0.0360 0.6975 0.0660 0.8916 0.0480 0.2643
% repeat for other classes or setup in a loop
  2 件のコメント
MOzhdeh Salimi
MOzhdeh Salimi 2021 年 7 月 24 日
thank you .
But my data are double and this code have erorr.
this is my code:
% read image and fit regression line%
VF = imread('Vf.tif');
Tnormal= imread('Tnormmsh.tif');
[i,j]=size(VF);
length=i*j;
X=VF(1:length);
Y=Tnormal(1:length);
Minx=min(X);
Maxx=max(X);
for X=Minx:0.01:Maxx
a=X
end
MOzhdeh Salimi
MOzhdeh Salimi 2021 年 7 月 24 日
your answer is completely true.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by