How do i contruct 3D Data like in my example
이전 댓글 표시
x,y are the coordinates of the circle points.
z is the brightness of the points.
so i have this

I want to create something like this (blue lines)

How can i do that? I tried some things with meshgrid, surf() and i tried to use scatteredInterpolant() too but i cant really figure it out.
Anyone know some useful keywords or functions?
Here is the code used to generate the plots...
A = readmatrix('simucoord.txt')
x = A(:,1)
y = A(:,2)
z = A(:,3)
Radii = floor(A(:,4))
%plotting the data
plot3(x,y,z, 'r*')
%%%IGNORE EVERYTHING BELOW%%%
x_center = 1.2533*10^3; %from simulation_23072020.mlx
y_center = 0;
clear x y z
%Plotting the data with the help of the Radii
th = 0:pi/50:pi;
x{1} = Radii(1) .* cos(th)-x_center;
y{1} = Radii(1) .* sin(th);
z{1} = ones(length(x{1}),1)*4;
x{2} = Radii(25) .* cos(th)-x_center;
y{2} = Radii(25) .* sin(th);
z{2} = ones(length(x{1}),1)*4;
x{3} = Radii(77) .* cos(th)-x_center;
y{3} = Radii(77) .* sin(th);
z{3} = ones(length(x{1}),1)*4
x{4} = Radii(99) .* cos(th)-x_center;
y{4} = Radii(99) .* sin(th);
z{4} = ones(length(x{1}),1)*3
x{5} = Radii(133) .* cos(th)-x_center;
y{5} = Radii(133) .* sin(th);
z{5} = ones(length(x{1}),1)*3
plot3(x{1}, y{1}, z{1}, x{2}, y{2}, z{2}, x{3}, y{3}, z{3}, x{4}, y{4}, z{4}, x{5}, y{5}, z{5})
xlim([0 1000])
ylim([0 1000])
댓글 수: 7
Cris LaPierre
2020년 7월 23일
I'm confused. I think we need more information to help. What is the point of X and Y? For the plotting code you share, you make up the x and y data rather than using the imported data.
Hoschang Noori
2020년 7월 23일
편집: Hoschang Noori
2020년 7월 23일
KSSV
2020년 7월 23일
Your (x,y) are points lying on different circles. I have no idea how it is possible to get the picture attached.
Hoschang Noori
2020년 7월 23일
Cris LaPierre
2020년 7월 23일
I think the point is we do not know what the blue lines you are drawing on the plot are supposed to be. Do you know how to create them and are asking for help on how to add it to the existing plot, or are you asking for help in creating the data?
Hoschang Noori
2020년 7월 24일
편집: Hoschang Noori
2020년 7월 24일
Hoschang Noori
2020년 7월 24일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


