Is it possible to use known data to apply a gradient to 3d shape?
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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.
3-D Solution and Gradient Plots with MATLAB Functions- https://in.mathworks.com/help/pde/ug/3d-solution-and-gradient-plots-with-matlab-functions.html
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!