Plotting more than one graph onto a 3d plot
古いコメントを表示
Despite having used the hold on function the code below only gives me 1 curve for an ODE I wish to plot with 3 separate initial conditions.
w_initial = [-1; .1; -.1]; %column vector containing initial values
[t, w] = ode45(@thefunc, t_duration, w_initial);
figure
plot3(w(:,1),w(:,2), w(:,3), '.');
grid on;
w_initial = [.4; -1; .2]; %column vector containing initial values
[t, w] = ode45(@thefunc, t_duration, w_initial);
figure
plot3(w(:,1),w(:,2), w(:,3), '.');
hold on;
w_initial = [-.5; 0; 0]; %column vector containing initial values
[t, w] = ode45(@thefunc, t_duration, w_initial);
figure
plot3(w(:,1),w(:,2), w(:,3), '.');
hold off;
grid on;
回答 (1 件)
Walter Roberson
2021 年 1 月 30 日
0 投票
Remove the calls to figure
Move the call to "hold on" to after the first plot3() call
2 件のコメント
matlab_day
2021 年 1 月 30 日
編集済み: matlab_day
2021 年 1 月 30 日
Walter Roberson
2021 年 1 月 30 日
Remove all the calls to figure()
カテゴリ
ヘルプ センター および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!