test1_1 - dist = sqrt(dist fprintf'The distance...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Spring 2011 Test 1 #1 answer % clear clc c again = 'yes'; while strcmpi (again, 'yes') pt1 = input('Enter your first point[x1, y1, z1]: \n'); pt2 = input('Enter your first point[x2, y2, z2]: \n'); dist = sum((pt1-pt2).^2);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: dist = sqrt(dist); fprintf ('The distance between (%.2f, %.2f, %.2f) and (%.2f, %.2f, %.2f) is %.2f \n',. .. pt1, pt2, dist); again = input ('Would you like to do it again (yes or no): \n', 's'); end...
View Full Document

This note was uploaded on 05/01/2011 for the course HCSC 110 taught by Professor Amosjohnson during the Spring '11 term at Morehouse.

Ask a homework question - tutors are online