Need help in 3d plot

조회 수: 5 (최근 30일)
Jad Diab
Jad Diab 2020년 11월 14일
답변: Star Strider 2020년 11월 14일
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

답변 (1개)

Star Strider
Star Strider 2020년 11월 14일
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.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by