Need help in 3d plot

5 views (last 30 days)
Jad Diab
Jad Diab on 14 Nov 2020
Answered: Star Strider on 14 Nov 2020
I have a variation of a certain value "I" with respect to each hour (as data, not as a function), so an array of 24 elements each day for "I", and I have experimental data for it for every day of the year.
I need to 3d plot this data, on one axis time in hour from 1 to 24, on the other axis "I" varying every hour, and on the third axis the days of the year (1 to 365) considering the experimental data of "I" varies from day to day too.
How to I do a 3d plot of this? also do I put all the values of I in the array as 24 columns (for the hours) and 365 rows? or what is better to 3d plot them?
Please if anyone can help I am new here, thank you

Answers (1)

Star Strider
Star Strider on 14 Nov 2020
Try this (with your matrix of ‘I’ values):
I = randn(24,365); % Create Data (For Lack Thereof)
Hr = 0:23; % Hours
Dy = 1:365; % Days
figure
surf(Dy, Hr, I)
grid on
xlabel('Days')
ylabel('Hours')
zlabel('I')
It may be necessary to reverse the first two arguments (and their respective axis labels) if your ‘I’ matrix is transposed from the one I created.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!