C++ style guide: Difference between revisions
Jump to navigation
Jump to search
(Add section for lambda expressions) |
(Replaced content with "% Esfera theta = linspace(0, 2*pi, 300); phi = linspace(0, pi, 300); [Theta, Phi] = meshgrid(theta, phi); r = 5; % Radio x = r * sin(Phi) .* cos(Theta); y = r * sin(Phi) .* sin(Theta); z = r * cos(Phi); figure; subplot(1,2,1) surf(x, y, z); title("Esfera"); xlabel("X"); ylabel("Y"); zlabel("Z"); shading interp; axis equal; subplot(1,2,2) contourf(x, y, z); title("Curvas de Nivel"); xlabel("X"); ylabel("Y");") Tags: Replaced Reverted |
||
Line 1: | Line 1: | ||
% Esfera | |||
theta = linspace(0, 2*pi, 300); | |||
phi = linspace(0, pi, 300); | |||
[Theta, Phi] = meshgrid(theta, phi); | |||
r = 5; % Radio | |||
x = r * sin(Phi) .* cos(Theta); | |||
y = r * sin(Phi) .* sin(Theta); | |||
z = r * cos(Phi); | |||
figure; | |||
subplot(1,2,1) | |||
surf(x, y, z); | |||
title("Esfera"); | |||
xlabel("X"); ylabel("Y"); zlabel("Z"); | |||
shading interp; | |||
axis equal; | |||
subplot(1,2,2) | |||
contourf(x, y, z); | |||
title("Curvas de Nivel"); | |||
xlabel("X"); ylabel("Y"); | |||
Revision as of 20:03, 1 December 2024
% Esfera theta = linspace(0, 2*pi, 300); phi = linspace(0, pi, 300); [Theta, Phi] = meshgrid(theta, phi);
r = 5; % Radio x = r * sin(Phi) .* cos(Theta); y = r * sin(Phi) .* sin(Theta); z = r * cos(Phi);
figure; subplot(1,2,1) surf(x, y, z); title("Esfera"); xlabel("X"); ylabel("Y"); zlabel("Z"); shading interp; axis equal;
subplot(1,2,2) contourf(x, y, z); title("Curvas de Nivel"); xlabel("X"); ylabel("Y");