how to convert time unit in graphic
1 回表示 (過去 30 日間)
古いコメントを表示
i have a trouble to make my task,
i use gui matlab to show a graph.
the graph i build from the calculated differential equation use ode45 with step size 1 hour.
there is 1 until 2160 hour. and i want to show the graph time unit in 'days' without change the step size of my ode45, so how can i do?
0 件のコメント
採用された回答
Walter Roberson
2013 年 5 月 20 日
For example,
plot(t(:,1), y(:,1))
curtick = get(gca, 'xtick');
newlab = cellstr( num2str( curtick(:) ./ 24 ) );
set(gca, 'xticklabel', newlab)
2 件のコメント
Walter Roberson
2013 年 5 月 20 日
plot(t(:,1), y)
When you specify multiple numeric vector arguments for plot() you need to use the pattern x1 y1 x2 y2 x3 y3 ... Alternately you can use a common x, and specify the y as a matrix where the columns of y form the different lines. Your y(:,1), y(:,2) etc. are already columns in the "y" matrix, so you can give it as a single argument to draw all 8 of the columns.
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!