test_hypersphere_volume.m
来自「一个用EM算法的源程序」· M 代码 · 共 21 行
M
21 行
% 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 + =
减小字号Ctrl + -
显示快捷键?