📄 test_hypersphere_volume.m
字号:
% Test function for hypersphere volume.clc; clear all; close all;% Check the volume for a couple special cases.r = 13;hypersphere_volume(1, r) - 2*rhypersphere_volume(2, r) - pi*r^2hypersphere_volume(3, r) - 4/3 * pi * r^3% Display the volume of the unit hypersphere as a function of dimension.dimensionCount = 20;volume = zeros(1,dimensionCount);for dimensionIndex = 1:dimensionCount, volume(dimensionIndex) = hypersphere_volume(dimensionIndex);endplot(1:dimensionCount, volume, '*')title('Volume of a unit hypersphere a function of Dimension')xlabel('Dimension')ylabel('Volume')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -