📄 test_dist2.m
字号:
% Script file: test_dist2.m
%
% Purpose:
% This program tests function dist2.
%
% Record of revisions:
% Date Programmer Description of change
% ==== ========== =====================
% 12/15/98 S. J. Chapman Original code
%
% Define variables:
% ax -- x-position of point a
% ay -- y-position of point a
% bx -- x-position of point b
% by -- y-position of point b
% result -- Distance between the points
% Get input data.
disp('Calculate the distance between two points:');
ax = input('Enter x value of point a: ');
ay = input('Enter y value of point a: ');
bx = input('Enter x value of point b: ');
by = input('Enter y value of point b: ');
% Evaluate function
result = dist2 (ax, ay, bx, by);
% Write out result.
fprintf('The distance between points a and b is %f\n',result);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -