data = importdata('data.txt') ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; dt = delaunayTriangulation(x,y) ; tri = dt.ConnectivityList ; xi = dt.Points(:,1) ; yi = dt.Points(:,2) ; F = scatteredInterpolant(x,y,z); zi = F(xi,yi) ; trisurf(tri,xi,yi,zi) view(2) shading interp Answer from KSSV on mathworks.com
🌐
MathWorks
mathworks.com › matlabcentral › answers › 373888-plot-surface-with-3-vectors-x-y-z
Plot surface with 3 vectors x,y,z? - MATLAB Answers - MATLAB Central
December 20, 2017 - I have 3 vectors with a few 1000 measurement points. How do I 3D plot this data where x is on the x-axis and so on? I tried comet3 and surf but can't figure it out. Played a little with meshgrid but dont think its what I want. I need to plot data were I can see that when x was 10 that y and z were some values. Sign in to comment. Sign in to answer this question. ... https://www.mathworks.com/matlabcentral/answers/373888-plot-surface-with-3-vectors-x-y-z#answer_297960
🌐
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › line plots
plot3 - 3-D line plot - MATLAB
Plot all three sets of coordinates on the same set of axes. ... Create vectors xt, yt, and zt.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 590290-using-plot3-to-plot-3d-vectors
Using plot3 to plot 3d vectors - MATLAB Answers - MATLAB Central
September 7, 2020 - The following code is meant to plot the vectors (4,5,6), (-3,6,-3) and (1,2,3) directed from the origin. plot3([0 4], [0 5], [0 6], 'k^--',[0 -3], [0 6], [0 -3], 'b^--', [0 1],... [0 2],[0 3],...
Top answer
1 of 1
4

you can create a 3d picture with an interpolated mesh:

x=[703 704 705 706 762 760 762 764 766 766 771 771 828 831 502 836 891 892 895 318 320   379 379 382 383 384 442 443 444 444 445 447 449 511 508 511 509 509 510 509 510 574 573 573 573 573 573 574 576 575 578 635 635 634 637 637 639 641 642 643 827 827 828 644 697 697 891 698 699 892 704]
y=[498 563 629 692 179 241 305 371 435 498 561 624 429 496 176 559 374 430 565 502 565 374 439 505 569 631 183 312 375 440 501 567 631 247 309 373 438 502 566 628 694 181 244 308 372 437 502 565 629 693 755 181 245 310 372 436 500 564 629 693 244 308 371 755 180 244 308 308 372 503 436]
z=[71172.63 59691.115 41209.71 45061.89 59223.98 42330.585 41934.85 66172.105 45911.76 45078.01 68746.4 51346.567 57932.58 48625.975 42202 44483.783 62927.595 53761.958 43314.128 42754.26 31610.293 45376.275 34661.647 35105.147 39571.948 38936.785 83547.518 39633.85 44048.802 35590.97 49392.215 38008.345 42108.543 47486 26103 28599 31419 29271.158 41591.745 32203.217 35669.092 50788.315 29967.715 30581.138 30694.737 33782.143 40074.855 28531.265 38337.658 31429.015 33893.448 58948.058 39229.93 39465.64 37449.57 40265.768 43811.802 42839.647 50270.707 55402.198 54075.66 43573.7325 38312.1075 57198.402 58962.967 50880.345 52337.115 59699.333 43770.645 55210.7025 77166.775]

% interpolation on regular grid
xlin=linspace(min(x),max(x),50);
ylin=linspace(min(y),max(y),50);
[X,Y]=meshgrid(xlin,ylin);
Z=griddata(x,y,z,X,Y,'cubic'); 

% visualization
mesh(X,Y,Z);
axis tight; hold on
plot3(x,y,z,'.', 'MarkerSize',15)
xlabel('x')
ylabel('y')
%surf(X,Y,Z)

The result looks like:

The code is explained in detail by doug on his site.
Of course you can replace the 'cubic' interpolation by a 'linear' one..

🌐
MathWorks
mathworks.com › matlabcentral › answers › 124195-3d-plot-of-3-vectors
3D plot of 3 vectors - MATLAB Answers - MATLAB Central
April 2, 2014 - https://www.mathworks.com/matlabcentral/answers/124195-3d-plot-of-3-vectors#comment_206119 · Cancel Copy to Clipboard · Thank you for your swift answer.It is not going to work I tried it. Let me explain what are my matrices. the time values are approximately 50o in length. I did my measurements with 3 different inductances and the current values vary in length.
Find elsewhere
🌐
MathWorks
mathworks.com › matlab › graphics › 2-d and 3-d plots › vector fields
quiver3 - 3-D quiver or vector plot - MATLAB
To create a 3-D quiver plot using cylindrical or spherical coordinates, first convert them to Cartesian coordinates using the pol2cart or sph2cart function. ... This function accepts GPU arrays, but does not run on a GPU. For more information, see Run MATLAB Functions on a GPU (Parallel Computing ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 1950523-how-to-create-a-surface-plot-having-3-vectors
How to create a surface plot having 3 vectors? - MATLAB Answers - MATLAB Central
April 20, 2023 - But without any kind of intelligence to guide it, surf can do nothing more than give up. It is you who needs to first decide what is the connectivity of those points, and then form it into something that surf is designed to handle. The onus is on you here, the user. ... https://www.mathworks.com/matlabcentral/answers/1950523-how-to-create-a-surface-plot-having-3-vectors#comment_3162646
🌐
AlgorithmMinds
algorithmminds.com › home › mastering 3d plotting in matlab: a comprehensive guide
3D Plotting in MATLAB - Comprehensive Guide
March 17, 2025 - Understanding the syntax and parameters associated with these commands is essential for effective data representation. The plot3 function is ideal for creating 3D line plots. The basic syntax involves three vectors as inputs: x, y, and z.
🌐
Carnegie Mellon University
andrew.cmu.edu › user › yuchingw › 3dplot.pdf pdf
3D Graphics in MATLAB We'll introduce different types of plotting in 3D.
We'll introduce different types of plotting in 3D. MATLAB has different plotting approaches for showing data in ... PLOT3() is a three-dimensional analogue of PLOT(). PLOT3(x,y,z), where x, y and z are three vectors of the same · length, plots a line in 3-space through the points whose
🌐
MathWorks
mathworks.com › matlab mobile › matlab mobile fundamentals
Creating 3-D Plots - MATLAB & Simulink
This example shows how to create 3-D line plots in MATLAB using the plot3 function. Create a regularly-spaced vector t from 0 to 10*pi using pi/50 as the increment between elements.
🌐
DipsLab
dipslab.com › home › blog post › 5 matlab 3d plot examples explained with code and colors
5 MATLAB 3D Plot Examples Explained with Code and Colors
April 30, 2020 - At the end of this post, you will be able to draw your own 3D plot graph in MATLAB. It’s amazing. Right? Let’s start. ... In general, the three-dimensional plots consist of the three vectors (x,y,z) in the same graph.
🌐
MathWorks
mathworks.com › matlabcentral › answers › 183288-3d-surface-plots-from-3-vectors
3D surface plots from 3 vectors? - MATLAB Answers - MATLAB Central
March 15, 2015 - I have 3 vectors. v1, v2, and v3. All are vectors with n number of elements in them. How to draw a surface plot. Matlab asking to make the Z axis a square matrix. Is there a way to represent the v3 matrix in matrix form? So we can create the Z bus matrix ad use 'surf' command? Sign in to comment. Sign in to answer this question. ... https://www.mathworks.com/matlabcentral/answers/183288-3d-surface-plots-from-3-vectors#answer_171439
🌐
GeeksforGeeks
geeksforgeeks.org › software engineering › 3d-plots-in-matlab
3D Plots in MATLAB - GeeksforGeeks
May 9, 2021 - Quiver plot: A quiver plot or vector plot is a type of plotting that gives directional components of u, v, w using the cartesian components x, y, and z. For plotting of quiver plot use quiver3(). ... % give the input value for x, % y and z [x,y,z]= ...
🌐
MathWorks
mathworks.com › matlabcentral › answers › 30838-simple-3d-vector-plotting
Simple 3D vector plotting - MATLAB Answers - MATLAB Central
March 1, 2012 - The x, y, and z inputs represent where you want the base of the vector to be drawn and the u, v, and w inputs represent the three components of the vector. For drawing straight lines and arcs use line. See the documentation for examples of how to use it. For adding labels use text. Again, the documentation has useful examples. ... How can I draw a single 3d vector.