add additional parameter to contour plot to generate 3d plot
显示 更早的评论
I have an equation which has 3 unknown variables V, s, and T. I want to produce a contour plot that shows what happens when each of these variables changes. Currently I can do this by creating a vector for both V and T but keep s as a constant:
V = 1:250;
T = linspace(1,25,length(V));
s = 30;
for j = 1:length(T)
D(j,:) = (3.*V.*(s^2))./(T(j).*((T(j).^2)-...
(3.*T(j).*s)+(3.*(s.^(2)))));
end
Then by plotting D as a contour plot:
pcolor(T,V,D');shading interp
we can see that when V is large and T is small, D will be large. From here, I would like to generate a 3d plot where I can also show the influence of changing 's'. At the moment 's' is a constant, so I can show how s affects the outcome by producing say 4 different figures for 4 different values of s. However, it would be better if I could generate one plot with 3 axis showing how D varies with V, T, and s. Could anyone provide some information about the best way of doing this?
采纳的回答
更多回答(1 个)
Thorsten
2013-2-18
You can use scatter3 and experiment with the size and the color of the dots
scatter3(X(:), Y(:), Z(:), 100*map01(V(:))+0.1, 255*(map01(V(:))), 'filled')
类别
在 帮助中心 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!