Plot a single vector as a line
39 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Anthony Mason
le 26 Juin 2019
Commenté : infinity
le 26 Juin 2019
How would you plot a 3 dimensional vector as a single line? I need to plot the null space of a matrix and having trouble finding the correct way to create the graph. Matrix is : [1,3,11;4,2,14;-2,-2,-10] , and the Null space is the vector [-2;-3;1]. It should just be a line because I am also plotting the column space of the matrix which is a plane. Any help would be greatly appreciated.
3 commentaires
infinity
le 26 Juin 2019
Hello,
Here you can see an example in 2D, the column space and null space are draw.
I think in your case (3D), you can plot as a answer below.
Réponse acceptée
Vismay Raj
le 26 Juin 2019
assuming that you want to draw a vector starting from (0,0,0) and to the specified point the following code can be used
v = [-2;-3;-1] % or any vector that you've obtained
t = linspace(0,1,100)
e = v*t
plot3(e(:,1),e(:,2),e(:,3))
see plot3 function for more https://www.mathworks.com/help/matlab/ref/plot3.html
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!