How do i contruct 3D Data like in my example
Show older comments
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 Comments
Cris LaPierre
on 23 Jul 2020
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
on 23 Jul 2020
Edited: Hoschang Noori
on 23 Jul 2020
KSSV
on 23 Jul 2020
Your (x,y) are points lying on different circles. I have no idea how it is possible to get the picture attached.
Hoschang Noori
on 23 Jul 2020
Cris LaPierre
on 23 Jul 2020
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
on 24 Jul 2020
Edited: Hoschang Noori
on 24 Jul 2020
Hoschang Noori
on 24 Jul 2020
Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

