⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 table.m

📁 图像分割算法的Matlab源程序
💻 M
字号:
%  Script file: table.m
%
%  Purpose: 
%    To create a table of square roots, squares, and
%    cubes. 
%
%  Record of revisions:
%      Date       Programmer          Description of change
%      ====       ==========          =====================
%    12/20/98    S. J. Chapman        Original code 
%
% Define variables:
%   cube         -- Cubes
%   ii           -- Index variable
%   square       -- Squares
%   square_roots -- Square roots
%   out          -- Output array

% Print the title of the table.
fprintf(' Table of Square Roots, Squares, and Cubes\n\n');    

% Print column headings
fprintf(' Number  Square Root    Square     Cube\n');
fprintf(' ======  ===========    ======     ====\n');

% Generate the required data
ii = 1:10;
square_root = sqrt(ii);
square = ii.^2;
cube = ii.^3;

% Create the output array
out = [ii' square_root' square' cube'];

% Print the data
for ii = 1:10
   fprintf ('  %2d   %11.4f   %6d   %8d\n',out(ii,:));
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -