Basic 2D-contour plot
31 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I am very new to Matlab and want to use it for a very basic data visualisation. I found some examples about 2D-contour plots, but no example worked for me and sometimes I had difficulties understanding certain functions.
I have a data file, which contains coordinates in x- and y-direction (first row and first column of an excel sheet). For every given position of these x- and y-coordinates there is a value.
There are plots that look very similar to what I aim for in the end:

My problem is, that getting the data out of my excel-file seems complicated and I don't know how to assign the coordinates to the values in Matlab.
I have currently a visualisation, but this one is based on Excel and does not fit certain optical requirements:

Also the interpolation of data between measured values is not very well done.
I am very glad about every answer that helps!
Best regards
Moritz
0 Commenti
Risposte (1)
Star Strider
il 1 Ago 2022
Modificato: Star Strider
il 1 Ago 2022
One optiono is to use the first column and first row as the appropriate coordinate vectors, and then the rest of the matrix as the array to use with contourf.
I am not certain what result you want.
One possibility —
Data = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1084750/data.xlsx')
xv = Data(1,2:end);
yv = Data(2:end,1).';
Cm = Data(2:end, 2:end);
figure
contourf(xv, yv, Cm)
colormap(jet)
colorbar
xlabel('X')
ylabel('Y')
EDIT — (1 Aug 2022 at 14:23)
.
2 Commenti
Vedere anche
Categorie
Scopri di più su Orange 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!
