Plot 1D data of electromagnetics simulation

7 vues (au cours des 30 derniers jours)
dj1du
dj1du le 26 Oct 2021
Réponse apportée : Nipun le 15 Avr 2024
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.

Réponses (1)

Nipun
Nipun le 15 Avr 2024
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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by