Extract random sample x,y,z data inside the circle
古いコメントを表示
Hello,
I want to know how to extract x,y,z data inside a circle. I already make a code. Here is my code :
clear;
deformA = xlsread ('deform.xlsx');
x=deformA(:,1)';
y=deformA(:,2)';
z=deformA(:,3)';
figure
scatter3(x,y,z,5,z,'filled') %plot x,y,z data
view (5,90)
r = 50; %circle radius
t = 0 : .01 : 2*pi; % 0 - 360 degree
a0 = 440250; % x point center in UTM
b0 = 9164550; % y point center in UTM
a1 = a0 + r*cos(t);
b1 = b0 + r*sin(t);
???
I have almost 232.040 deformation data and I want to take some sample points inside the circle. I just feel confuse with the next step. I want to save the x,y,z data inside the circle in excel file. I will very happy if somebody can help me. thanks
regards, Herlan
採用された回答
その他の回答 (1 件)
Image Analyst
2014 年 11 月 4 日
0 投票
Get all the XYZ locations, which I think you know how to do.
Then get random selections using the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_set_of_random_locations_within_a_circle.3F. Adapt it slightly from a circle to a sphere of course.
Let us know if you still can't figure it out.
1 件のコメント
Image Analyst
2014 年 11 月 4 日
Use xlswrite if you want to save the x,y,z locations and the data value at those locations to an Excel workbook.
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!