How can I do contour plot from set of data from .xlsx?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I get this code from this website http://linuxrajib.blogspot.com/2012/04/2d-contour-plot-in-matlab.html but I don't know how to do with it. I want to do contour plot like this in my .xlsx file. (.xlsx file in the attachment)
clear all;
close all;
L1 = load('dataset1.dat');
N1=6;
N2=220;
k = 1;
for i = 1 : 1 : N1
for j = 1 : 1: N2
k = (i - 1) * N2 + j;
X1(j,i) = L1(k, 1);
Y1(j,i) = L1(k, 2);
Z1(j,i) = L1(k, 3);
end
end
contourf(X1, Y1, Z1);
lighting gouraud
xlim([0.0 0.6])
ylim([0.04 0.09])
set(gca, 'xtick', 0.0:0.1:0.6,'Fontsize', 15)
set(gca, 'ytick', 0.04:0.01:0.09,'Fontsize', 15)
xlabel('xlabel text','Fontsize', 20);
ylabel('ylabel text','FontSize', 20);

0 Commenti
Risposte (1)
Jacob Mathew
il 3 Gen 2025
Hey Nanthanon,
You can refer to the following documentation to understand how to load spreadsheets into MATLAB:
https://www.mathworks.com/help/releases/R2024b/matlab/import_export/ways-to-import-spreadsheets.html
Once you have the required data from the spreadsheet, refer to the following documentation to create contour plots:
0 Commenti
Vedere anche
Categorie
Scopri di più su Contour Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!