You can use the plot
function in MATLAB to draw the graph of y = x^2.
Here is an example code snippet:
main.m269 chars17 lines
This code will create a graph with the range of x values from -10 to 10 with a step of 0.1. The y values are calculated as the square of each x value. The graph is then plotted using the plot
function. You can also customize the labels, title, and grid lines as needed.
gistlibby LogSnag