Professional Documents
Culture Documents
Introduction to MATLAB
Lab Experiment#1
Report Tasks:
1. Write a MATLAB function to compute the average (mean) of a vector
x, then call and execute the function from the command window. (Do
not use the mean(x) function).
2. Plot the graph of the sine function using values of x ranging from 0 to
and label the x- and y- accesses.
Conclusion:
In this lab, we learned about commands of Arithmetic Operations, Array
Indexing, Allocating memory, Special Characters and functions, Control
flow, Operators and Plotting. For the report task, we discovered how to write
a command to find the average without using the mean command. We used
function to calculate average of vector and used the commands we learnt to
plot a sine wave.