I have a question about plot. Plesase help me.
Mostra commenti meno recenti
I want to draw a line x = a perpendicular to the x axis in matlab. How do I do ? (with a = constant) value y from 3 to 5.
Risposta accettata
Più risposte (1)
% define your constant:
a = 5;
% define y limits
ymin = -10;
ymax = 10;
% define x and y values
x = a*ones(2,1);
y = linspace(ymin,ymax,length(x));
% plot the result
figure()
plot(x,y,'r-')
xlabel('x')
ylabel('y')
title('plot of x = a')
3 Commenti
Azzi Abdelmalek
il 20 Dic 2013
You don't need 500 points to plot a line
Geert
il 20 Dic 2013
Corrected it...
Nguyen Trong Nhan
il 20 Dic 2013
Categorie
Scopri di più su Annotations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!