Question
>> % Prompt user to enter coordinates of three points >> P1 = input('Enter the x and y coordinates of P1 in the form [x
>> % Prompt user to enter coordinates of three points >> P1 = input('Enter the x and y coordinates of P1 in the form [x y]: ') Enter the x and y coordinates of P1 in the form [x y]: P1 = [] >> P2 = input('Enter the x and y coordinates of P2 in the form [x y]: ') Enter the x and y coordinates of P2 in the form [x y]: P2 = [] >> P3 = input('Enter the x and y coordinates of P3 in the form [x y]: ') Enter the x and y coordinates of P3 in the form [x y]: P3 = [] >> % Plot the triangle in x-y plane >> plot([P1(1) P2(1) P3(1) P1(1)], [P1(2) P2(2) P3(2) P1(2)], '-o') Index exceeds the number of array elements. Index must not exceed 0. not correct
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started