Azzera filtri
Azzera filtri

Scatter plot to contour plot

10 visualizzazioni (ultimi 30 giorni)
mads skibsted
mads skibsted il 24 Apr 2024
Risposto: Brahmadev il 24 Apr 2024
Can you help me using this function https://www.mathworks.com/matlabcentral/fileexchange/38858-contour-plot-for-scattered-data with the data attached?
I want to go from a scatter plot (below) to a contour plot.

Risposte (1)

Brahmadev
Brahmadev il 24 Apr 2024
You can use the following code for contour plot of your data:
filePath = 'filePath/k.txt'; % Define the file path
dataMatrix = readmatrix(filePath);
zz = dataMatrix(:, 3);
v=-50:0.001:50; % contour levels
tri=delaunay(dataMatrix(:, 1), dataMatrix(:, 2));
[C,h]=tricontour(tri,dataMatrix(:, 1),dataMatrix(:, 2),zz,v);
Hope this helps!

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by