MATLAB: How to plot 3 variables (3rd variable on the colorbar)

plotting

I have three variables (below). I wonder on how will I plot it to achieve something similar with the attached picture?
X = day in a year (1 to 365) –> in days
Y = time in a day (1 up to 24) –> in hours
Z = load data in kW say for example

Best Answer

That looks like a surf plot, using
view(0,90)
to create a 2D plot from it.
How you plot it depends on how your data are organised. The surf function plots a matrix as the third argument, although the first two arguments can be vectors.
EDIT —
Your data are gridded. You can convert them into matrices needed for the surf function using the reshape (link) function, specifically:
D = xlsread('YourFile.xls'); % Use The Appropriate Function To Import Your Data
Xm = reshape(D(:,1), 24, []);
Ym = reshape(D(:,2), 24, []);
Zm = reshape(D(:,3), 24, []);
figure
surf(Xm, Ym, Zm)
view(0,90)
grid on
colorbar