Cairo University Faculty of Engineering Credit Hour System GENN004
Lab 01 MATLAB Basics
________________________________________________________________________ All scripts should be stored in your FirstLastName folder and have clear names 1. Create and execute the following program (script). Fix all errors if any and show the results to your lab instructor. a = 1; b = 5; c = 6; d = sqrt(b^2 - 4*a*c); r1 = (-b - d)/(2*a) r2 = (-b + d)/(2*a) Add a comment at the beginning of the script stating the purpose of this script and your name. 2. Write and execute a script to calculate the area of a rectangle (triangle, circle, ) area=length * width; 3. Write and execute a script to calculate the distance between two points (x1,y1) and (x2,y2) dist=sqrt((x2-x1)^2+(y2-y1)^2); 4. Write and execute a script to calculate your own equation(s).
Lab 01
1/1