Plotting values of an equation with linspace

3 views (last 30 days)
For an assignment, I have calculated values of properties of processes with the equation C=P*V^n, and now I have to plot these values using linspace.
For example, at the beginning of process 1, I have a value of P, V, and n in an array. I calculate the value of C at this point. Then I calculate the value of C with the P, V, and n from the end of the state in the array. Now I have to plot the line on a P vs V graph connecting these two points and interpolate it to create a curved line in between. I was going to use linspace to do this, but I'm very confused as to where exactly to use the linspace. I'm not sure where to begin especially since my P, V, and n values are stored in an array.
Do I use it in the calculations? Do I have to use it for every single variable including n, even though I am only plotting P versus V?
I hope this makes sense as I am pretty confused. Thank you!
  1 Comment
Marieke Klijn
Marieke Klijn on 21 Sep 2016
Hi Janell,
Are you sure you are interested in using the linspace function? Using this to connect two points will result in a linear line in your plot, and not in a curved line as you say.
Cheers, Marieke

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!