MATLAB Exercise
MATLAB Exercise
Experiment 2
Aim: To perform scalar and array operations on MATLAB variables,
arrays, multi-dimensional arrays, sub-arrays.
Apparatus: MATLAB Software
Objective:
1. To learn how different library functions can be used with
arrays and multi-dimensional arrays.
2. To learn how specific elements of an array can be accessed
and utilized in coding.
Problems:
Q-1. Answer the following questions for the array shown here.
ANS
Q-7. The distance between two points (x1, y1) and (x2, y2) on a
Cartesian coordinate plane is given by the equation,
Write a program to calculate the distance between any two points (x1,
y1) and (x2, y2) specified by the user. Use good programming
practices in your program. Use the program to calculate the distance
between the points (-3, 2) and (3, -6).
Conclusion:
In this experiment, we studied about types of array, array
operations on MATLAB variables, arrays, multi-dimensional
arrays, sub-arrays. We simulated given questions and observed
results.