3d line plot faster.

7 次查看(过去 30 天)
Jae-Hee Park
Jae-Hee Park 2022-6-13
回答: Nipun 2023-10-9
Hi
I am looking for 3D Line plot faster.
My plot data is continuous and has 1 to 86400*365*10 lines. (1sec ~10 years seconds)
Actually it is orbit position data.
But when I just plot just 30 days(86400*30 lines), Rotating the plot was too slow.I think It cause of data ploints are too many.
If I would like to plot faster, what can I do?
Should I interpolate for convert 1 sec data to 60 sec?
Thank for your help.
Here is my pseudo code on app designer.
variables...;
start_time = yyyy/mm/dd HH:MM:SS;
end_time = yyyy/mm/dd HH:MM:SS;
dt = end_time - start_time; % this will be seconds. so If the time interval is 30 days,
% then dt is 86400 * 30.
init_satellites_properties(); % this properties make sure the satellites orbit.
[x_,y_,z_] = function_for_get_orbit_position(app); % this function returns the positions
% of satellites by times.
% thus if the time interval is 30 days
% then size(x_),size(y_),size(z_) will be [1, 86400*30].
hold(app.FigureHandle,'on'0);
plot3(app.FigureHandle,x_,y_,z_);
hild(app.FigureHandle,'off');
% I wannt to rotate 3D plot smoothly but It has too much delay.
  3 个评论
Jan
Jan 2022-6-13
Voss hits the point: Withpout seeing the code, we cannot improve it.
Do you want to plot faster or does the question concern the rotation?
Do you really need 86400*30 lines? Creating more lines than the number of pixels of the monitor seems to be an overkill.
Jae-Hee Park
Jae-Hee Park 2022-6-14
@Voss@Jan I add my pseudo code! thank you.

请先登录,再进行评论。

回答(1 个)

Nipun
Nipun 2023-10-9
Hi Jae-Hee,
I understand that you are looking for a method to plot 3D lines faster. I assume that the mentioned function function_for_get_orbit_position that populates the x,y,z coordinates for the plot is considerably faster than the plot function and is not the bottleneck for optimization.
Given that you have data points of order for a period of 30 days, MATLAB needs to plot all the points for one interval. There is one way that may lead to considerable speed up in plotting: use interpolation to reduce the number of points and return an approximate trajectory.
The number of points in your current dataset is more than the number of pixels in a screen monitor - thereby making many points on screen redundant. You can use scatteredInterpolant to interpolate the points.
Additionally, you may leverage gridfit toolbox to plot the semi-scattered data, that is, the subset of the number of points in your original dataset.
Link to resources:
  1. 3D plot faster for large data - MATLAB Answer: https://in.mathworks.com/matlabcentral/answers/1401-3d-plot-with-large-data
  2. Interpolate 3D data: https://in.mathworks.com/help/matlab/ref/scatteredinterpolant.html
  3. Gridfit toolbox: https://in.mathworks.com/matlabcentral/fileexchange/8998-surface-fitting-using-gridfit
Regards,
Nipun

类别

Help CenterFile Exchange 中查找有关 Reference Applications 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by