Plotting values of an equation with linspace
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
Marieke Klijn
el 21 de Sept. de 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
Respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!