Plotting a V-shaped curve?

4 visualizzazioni (ultimi 30 giorni)
Jesse
Jesse il 7 Ott 2011
Hello all,
I don't know why I'm blanking out on this, but I am.
I'm trying to plot a V shaped curve. I need to plot 3 V's, if you will. All start at y = -0.5. The first V is centered at x = 32, and the bottom of the V goes down to y =-6. The width of the V is 9.
2nd V center is at x = 82, bottom of the V goes down to y = -10, and the width is 11.
Third V is centered at x = 152, again the bottom of the V goes down to y = -10, and the width is 51.
Straight lines connect the V's at -0.5, and the x scale is from 0 to 200.
I am aware of incrementing variables (for instance if you have x = [-4:1:4], x will increment in a for loop by 1 each time), but wasn't sure how to program in widths as you see with plotting V curves. Do you again invoke a for loop?
Thanks!

Risposta accettata

Walter Roberson
Walter Roberson il 7 Ott 2011
Consider using linspace()
  1 Commento
Jesse
Jesse il 7 Ott 2011
Yes - that's it! It's this IDL to MATLAB that's getting to me Walter. Thank you!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by