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!