Plotting values of an equation with linspace

조회 수: 3 (최근 30일)
Janell Lopez
Janell Lopez 2016년 9월 9일
댓글: Marieke Klijn 2016년 9월 21일
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
Marieke Klijn
Marieke Klijn 2016년 9월 21일
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

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by