How can I do contour plot from set of data from .xlsx?

조회 수: 2 (최근 30일)
Nanthanon Visitpongaree
Nanthanon Visitpongaree 2018년 11월 3일
답변: Jacob Mathew 2025년 1월 3일
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);

답변 (1개)

Jacob Mathew
Jacob Mathew 2025년 1월 3일
Hey Nanthanon,
You can refer to the following documentation to understand how to load spreadsheets into MATLAB:
Once you have the required data from the spreadsheet, refer to the following documentation to create contour plots:

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by