今日(きょう)(さわ)がしく(たわむ)れ生きる人々の漫画映画(まんがえいが)

Octave

注释在 comment 里了。

% one-lined comment
clc % clear screen
clear all % empties the variables
var1 = 10 % variable definition & assignment

x = 0:pi/10:pi
f = sin(x)
subplot(2, 2, 1); % semi-colon!
plot(x, f);
title("Sin?")

% dot product
z = x .* f

figure;
plot3(x, f, z);
xlabel("X"); ylabel("Y"); zlabel("Z");

p = -pi:pi/40:pi;
t = 0:pi/40:pi;
[P, T] = meshgrid(p, t);
theta = pi/2 - P;
phi = T;
figure;
R = sqrt(5/16/pi) * abs(3 * cos(theta) .* cos(theta) - 1);
[X, Y, Z] = sph2cart(theta, phi, R);
color = [0.5 0.5 0.5];
colormap(color);
plot3(X, Y, Z);

meshc

isosurface

什?

评论