Clear Filters
Clear Filters

Plotting a V-shaped curve?

5 views (last 30 days)
Jesse
Jesse on 7 Oct 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!

Accepted Answer

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

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!