Plot 1D data of electromagnetics simulation

5 Ansichten (letzte 30 Tage)
dj1du
dj1du am 26 Okt. 2021
Beantwortet: Nipun am 15 Apr. 2024 um 7:41
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.

Antworten (1)

Nipun
Nipun am 15 Apr. 2024 um 7:41
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

Kategorien

Mehr zu View and Analyze Simulation Results finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by