MATLAB产生一个信息表 【例】
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:15;
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:15
fprintf (' - .4f m �\n',out(ii,:));
end