Is it possible to use known data to apply a gradient to 3d shape?

조회 수: 1 (최근 30일)
CHARLEY GIESE
CHARLEY GIESE 2022년 3월 8일
답변: Pavan Sahith 2023년 11월 7일
Hello,
I have a thermal gradient that was measured via a cone calorimeter and I am currently trying to find a way to use this known data to show the gradient on a simple 3d model (just an 83x83x25.8 box). Is it possible for Matlab to do this? I've been looking for awhile and have not found any functions that seem to apply to this situation.

답변 (1개)

Pavan Sahith
Pavan Sahith 2023년 11월 7일
Hello Charley,
I understand that you have a thermal gradient and want to use this known data to show the gradient on a simple 3d model.
It is possible to visualize the thermal gradient on a 3D model using MATLAB. One way to do this is by using the patch function to create a 3D box and then using the scatter3 function to plot the temperature values at the appropriate locations within the box.
Please refer to this sample code with some example data
% Generate random temperature data
temp = rand(83, 83, 26) * 100;
% Define the coordinates of the box
x = linspace(0, 1, 83);
y = linspace(0, 1, 83);
z = linspace(0, 25.8, 26);
[X, Y, Z] = meshgrid(x, y, z);
% Create the 3D box
figure
box = patch(isosurface(X, Y, Z, temp, 50));
set(box, 'FaceColor', 'red', 'EdgeColor', 'none');
view(3);
% Add temperature values to the box
hold on
scatter3(X(:), Y(:), Z(:), 10, temp(:), 'filled');
colorbar
Please refer to this MathWorks documentation.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by