Matlab, skapa vertikala linjer med line() ?

Permalänk

Matlab, skapa vertikala linjer med line() ?

Kan någon förklara för mig hur jag gör för att lägga till vertikala linjer med ett avstånd av 100 enheter i en matlab plot?

Permalänk
Medlem

Nu kan jag inte testa då jag sitter med mobilen (och minnet sviktar lite kring syntaxen) men kan du inte göra något i stil med det här :
for i=1:100:1000
plot([i,i],[low_end_of_line, high_end_of_line])
end

Skickades från m.sweclockers.com

Permalänk

@mmarks: Tackar men det ska kunna göras via "line()" på något sätt där en rad ska räcka.

Permalänk
Medlem
Skrivet av burton666:

@mmarks: Tackar men det ska kunna göras via "line()" på något sätt där en rad ska räcka.

https://se.mathworks.com/help/matlab/ref/line.html#buzqtg4-y

Citat:
  • If x and y are both vectors with the same length, then line plots a single line.

  • If x and y are matrices with the same size, then line plots multiple lines. The function plots columns of y versus x.

  • If one of x or y is a vector and the other is a matrix, then line plots multiple lines. The length of the vector must equal one of the matrix dimensions:

    • If the vector length equals the number of matrix rows, then line plots each matrix column versus the vector.

    • If the vector length equals the number of matrix columns, then line plots each matrix row versus the vector.

    • If the matrix is square, then line plots each column versus the vector.