フィルターのクリア

Plot 2D flux maps in 3D

4 ビュー (過去 30 日間)
Philip Hoskinson
Philip Hoskinson 2018 年 12 月 8 日
回答済み: ProblemSolver 2023 年 7 月 13 日
How do I portray my 2D contourf plots in 3D?
I have three simple rectangular surfaces that I am plotting contourf maps of, but I want to connect their edges and portray in 3D (they are not in plane, sort of like a piece of paper folded at 90 degrees, or any degree for that matter).
So I have for example:
Panel 1
[ 23 54 ]
[34 65]
Panel 2
[76 34]
[34 65]
Actual widths and angles between panels are known. They are not perfect squares.
Eventually I want to connect multiple V-shaped panels, in a circular shape sort of like a car air filter.
Thanks!

回答 (1 件)

ProblemSolver
ProblemSolver 2023 年 7 月 13 日
% Define the data for the panels
panel1 = [23, 54, 0; 34, 65, 0]; % Replace with your data for panel 1
panel2 = [76, 34, 0; 34, 65, 0]; % Replace with your data for panel 2
% Define other panels as needed
% Define the vertices and faces for the patches
vertices = [panel1; panel2]; % Combine the vertices of the panels
faces = [1, 2, 4, 3]; % Define the face indices based on the vertex order
% Assign colors to the vertices
colors = [panel1(:, 1); panel2(:, 1)]; % Replace with your desired color values
% Plot the 3D surface
figure;
patch('Vertices', vertices, 'Faces', faces, 'FaceVertexCData', colors, 'FaceColor', 'interp', 'EdgeColor', 'none');
colorbar; % Add a colorbar if needed
% Customize the plot as needed
xlabel('X');
ylabel('Y');
zlabel('Z');
view(3); % Set the view perspective
% Add other customizations as needed

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by