How do i contruct 3D Data like in my example
2 ビュー (過去 30 日間)
古いコメントを表示
x,y are the coordinates of the circle points.
z is the brightness of the points.
so i have this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/336033/image.png)
I want to create something like this (blue lines)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/336036/image.png)
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 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!