Surf on a cylinder
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Marcus
el 8 de Jun. de 2024
Respondida: Matt J
el 8 de Jun. de 2024
How can I plot this surf
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1711466/image.png)
on a cylindrical surface, like this?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1711471/image.png)
0 comentarios
Respuesta aceptada
Matt J
el 8 de Jun. de 2024
% Step 1: Create the heatmap data
% Example heatmap data
heatmapData = peaks(50); % Replace this with your actual heatmap data
[nRows, nCols] = size(heatmapData);
% Step 2: Generate the cylinder coordinates
theta = linspace(0, 2*pi, nCols);
z = linspace(0, 1, nRows);
[Theta, Z] = meshgrid(theta, z);
X = cos(Theta);
Y = sin(Theta);
% Step 3: Map the heatmap data onto the cylindrical surface
figure;
surf(X, Y, Z, heatmapData, 'EdgeColor', 'none');
colormap(jet); % Adjust colormap as needed
colorbar;
title('Heatmap Mapped onto a Cylinder');
xlabel('X');
ylabel('Y');
zlabel('Z');
% Adjust the view for better visualization
view(3);
axis equal;
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Distribution Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!