

With plot you must use the first form because cell arrays are not allowed. However, now consider these two commands (again, these two lines are equivalent to each other): For example the following two commands do the same thing:Īlthough in the example above, y1, y2, and 圓 must be the same length so there really isn't a big advantage for the cell array input. Unlike plot, plt will accept data passed in cell arrays. However, you may call plt without any arguments, allowing you to choose the data to plot interactively.įind out about this method here: The Workspace Plotter. With plot the data to be plotted must be passed in via the argument list. Some of the ways that plt and plot differ will become clear from what follows. None of this so far should come as a surprise since it is identical to Matrices of the same size, plt(x,y) will create one However when plt is called from a program sometimes the line handles are needed to Most often when you type the plt command at the command prompt you don't need to save plt's return value.


H(1) of course would be the line handle associated with the y1 trace. Will return a 3 by 1 column vector h of handles. You can call plt using an output argument, which will return a column vector of trace handles. That would work only if the y1,y2,圓 were row vectors. In this case we can simply repeat the x vector in the Quite often several traces share the same x vector. For example this command plots three traces: To plot more than one trace, include the x and y vectors for each If y is a real vector, plt(y) is equivalent to If not you will get an error message saying that the vectors must be the same Will transpose one of the arguments if needed to line things up, so x could be a This plots the data in vector x along the horizontal axis and the data in Usually you will call plt with at least two arguments:
MATLAB LINE STYLE HOW TO
How to use plt and the differences between plt and the native Matlab plot. This section (not including the two large tables at the end) is a good introduction to Previous page next page Calling sequence and line styles
