In: Mechanical Engineering
Use MATLAB to create a vector x having six values between 0 and 10 (including the endpoints 0 and 10). Create an array A whose rst row contains the values 3x and whose second row contains the values 5x - 20.
We are required to create a vector x having six values between 0 and 10. A very useful MATLAB command to create the uniformly distributed array when the end points and length of array is known is linspace(a, b, n)
Here,
a is the starting point
b is the end point
n is the number of elements required
We also need to create an array A whose first and second row are to be obtained using the vector x.
A MATLAB program to create the above vector x and array A is shown below:
We are required to create a vector x having six values between 0 and 10. A very useful MATLAB command