标题:输入两个坐标求距离 NORM具体求法 步骤
只看楼主
汉堡爱天气
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-5-16
结帖率:100%
 问题点数:0 回复次数:1 
输入两个坐标求距离 NORM具体求法 步骤
NORM
2013-05-21 23:12
unix1993
Rank: 1
等 级:新手上路
帖 子:6
专家分:2
注 册:2013-7-31
得分:0 
程序代码:
function distance = dist2 (x1, y1, x2, y2)
distance = sqrt((x2-x1).^2 + (y2-y1).^2);
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:');
result = dist2 (ax, ay, bx, by);
fprintf('The distance between points a and b is %f \n', result);

嘿嘿,我是一个初学者。
2013-07-31 16:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-407688-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.022750 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved