Plot 1D data of electromagnetics simulation

7 次查看(过去 30 天)
Hello everyone,
I calculated the current on a conducting wire when being exposed to electromagnetic radiation and would like to plot this data in Matlab. The mesh data consists of 50 segments and 49 vertices and the current in each segment is known. For 2D data I successfully used trisurf in the past, but plotting 1D data is new to me. Is there some function like trisurf for 1D data, which gives a result like shown below? A simple graph, in which current and position acts as abscissa and ordinate is no alternative for me, it should be a spatial plot like in the given image.

回答(1 个)

Nipun
Nipun 2024-4-15
Hi,
I understand that you intend to plot a one dimensional data on a 3D plane in MATLAB as shown in the attached figure.
I assume that you that the data line is parallel to one axis, and at an offset to the other axis. In this case, the data varies along Y, has an offset at Z, and no dependency on X.
You can use the "plot3" function in MATLAB to plot the required data. Consider the following code in which a 1D line is plotted in 3D space.
n = 1000; % number of points
y_coord = linspace(0,100,1000); % data points
x_coord = zeros(size(y_coord)); % x-coordinates are 0
z_coord = 4*ones(size(y_coord));% same offset for all data points
% plot
plot3(x_coord, y_coord, z_coord)
For more information on "plot3" function in MATLAB, refer to the following MathWorks documentation:
Hope this helps.
Regards,
Nipun

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by