3D surface plot of integrated function
이전 댓글 표시
I'm trying to make a 3D plot to visually represent a plot I made in 2D. I've tried using cylinder, but it creates the solid in the wrong direction, over the x or z axis instead of the y-axis. Below is my code that creates the 2D plot. Is there a way to basically create a shell around the y-axis and represent it in 3D? I've tried using mesh but I can't seem to get things set up properly. Any help would be greatly appreciated!
function value = Function
r = [1:1:350];
S = 0.001;
T = 2400;
t = 1;
u = ((r.^2)*S)./(4*T.*t);
syms y
Wu = zeros(size(u));
for i = 1:length(u)
Wu(i) = integral(@(y)exp(-y)./(y),u(i),inf);
end
Q = 2400;
value = Q/(4*pi*T)*Wu;
%Plot
f1 = figure('Color', [1 1 1]);
ax1 = axes('FontSize', 18, 'FontWeight', 'bold');
plot(ax1, r, value);
title('Value v Distance');
xlabel('Distance (m)');
ylabel('Value');
set(gca,'Ydir','reverse');
ax = gca;
ax.FontSize = 13;
grid on;
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
