Here's what I have so far:
% Write a program using a for loop to get user input for a nX2 array, then find the difference between point 1 and the rest.
n=input('how many points do you have? ');A=zeros (n,2);for row=1:n for column=1:2 usernumber=input('enter a number: '); A(row, column)=usernumber; endendAfor row=1:length(A(n,2)) Dist=sqrt((A(n,1)-A(n+1,1))^2)+((A(n+1,2)-A(n,2))^2)endDist
I'm not sure how to find the differences through the loop and then store them
Best Answer