How can I draw i.e. x = 5 line in plot at Matlab?
I plot like that:
x = (-10:.1:10);
f= 10;
plot(x, f, 'r');
of course it doesn’t work. For every variable of x, y is equal to 0 except for x=10. When x = 10 y equals to everything. How to plot this?
In MATLAB,
plot(X, Y)simply draws points on the graph (and connects them with lines). Note that in this form of syntax,XandYmust have the same dimensions. Therefore, to plot the linex = 5create a vector of your desired y-coordinates, and then create matching x-coordinates, which are all equal to 5: