Matlab plot colors and labels

broken image
broken image

Let us take one more example to plot the function y = x 2. When you run the file, MATLAB displays the following plot −

broken image

Let us plot the simple function y = x for the range of values for x from 0 to 100, with an increment of 5.Ĭreate a script file and type the following code − To plot the graph of a function, you need to take the following steps −ĭefine x, by specifying the range of values for the variable x, for which the function is to be plottedįollowing example would demonstrate the concept.

broken image