Ploting 3D flow data (4D plot)
8 次查看(过去 30 天)
显示 更早的评论
Hi,
I will be doing CFD calculations with MATLAB in 3D. I have x,y,z coordinates and Temperature in each point. Assume I have 100 points in each direction I have 100*100*100 temperature points. I want to plot temperature (also make a movie) using color as the temperature intensity. Is there an easy way of doing it? I am not sure if scatter3 will work for me or not. ( I want to know if I need to invest time to learn paraview)
Thank you.
1 个评论
Walter Roberson
2013-4-5
What is your display resolution? Although in theory 100*100*100 has the same number of pixels as a 1000 x 1000 display, in practice the projection angle is going to require a lot of those voxels to be visually on top of one another.
How far "into" the cube needs to be visible from the outside?
回答(2 个)
Ahmed A. Selman
2013-4-5
Logically, no 4-D plot can be made sensible to us (unfortunately, we are stuck to see and understand 3-D world, only). So even if you could plot it somehow, understanding it will be quite tricky. Yet, fortunately this time, we can imagine n-D world theoretically (with n = 0 to inf).
Now, suppose your data set is something like D(x,y,z,T). At each point of (x,y,z) space, there is a (T) value that changes the behavior. So you want to visualize the (x,y,z) space at a given (T). Thus, the answer is (fix one coordinate, and change the other 3). The rest is how to do it.
When I needed it, I used to fix z-coordinate and plot (x,y) horizontally, with (T) in the vertical axis, as in the example below:
clc
clear
close all
for x=1:20;
for y=1:20;
for z=1:20
for T=1:20
D(x,y,z,T)=sin((T.*x.*z)*0.1); % creating 4-D array
end
end
end
end
[nio, njo, nko, nTo]=size(D);
surfl(D(:,:,1)); % Initial snapshot
for k=1:nTo; % fixing the z-coordinates
surfl(D(:,:,k))
xlabel(' X - Axis');
ylabel(' Y - Axis');
zlabel(' T - Axis');
title({' Z is fixed at: ' k })
pause (0.1);
CF(k)=getframe;
end
figure;
movie(CF); % This is the movie of the frames just displayed.
Please modify it to your own convenience, this is NOT the code you exactly need, but the method is, I think.
0 个评论
Omid Adljuy
2013-4-5
编辑:Omid Adljuy
2013-4-5
Probably the isosurface command is what you're looking for.
See MATLAB Help for more details and examples.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!