Filter löschen
Filter löschen

Plot associate two numbers

1 Ansicht (letzte 30 Tage)
Brave A
Brave A am 5 Feb. 2021
Kommentiert: KSSV am 5 Feb. 2021
Hi there,
I am trying to plot those numbers below but i need to associate them. For example I want the line coming from 0.04 and so on.
But the problem this plot them from 0.
Plot([0.04 70],'-.r*')
hold on
plot( [ 0.06 146 ],'--mo')
hold on
plot([ 0.05 161],':bs')
hold on
plot([ 0.07 193],'-.r*')
hold on
plot([0.08 197],'--mo')
hold off

Akzeptierte Antwort

KSSV
KSSV am 5 Feb. 2021
P = [0.04 70 ; 0.06 146 ; 0.05 161 ; 0.07 193 ; 0.08 197] ;
plot(P(:,1),P(:,2))
  6 Kommentare
Brave A
Brave A am 5 Feb. 2021
I need like your code but each them in line.
KSSV
KSSV am 5 Feb. 2021
P = [0.04 70 ; 0.06 146 ; 0.05 161 ; 0.07 193 ; 0.08 197] ;
[m,n] = size(P) ;
for i = 1:m-1
plot(P(i:i+1,1),P(i:i+1,2))
hold on
end

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by