Plotting graph with uneven amount of vectors

3 次查看(过去 30 天)
Hello everyone,
So, I want to plot a graph pressure over volume. Both values have been measured over a time of 0.85 seconds, however the pressure has been recorded at a 170 moments and the volume has been recorded at only 69 moments. How can I make this work?

采纳的回答

Walter Roberson
Walter Roberson 2019-2-14
take the later of the two start times and the earlier of the two end times. linspace some points between the two. interp1 the pressure at those query points and the temperature at those query points . Now you can plot the interpolated values against each other .
  3 个评论
Walter Roberson
Walter Roberson 2019-2-14
you would linspace on time. Time will not loop but the parametric plot of pressure vs volume could loop.
Walter Roberson
Walter Roberson 2019-2-14
N = 100;
qt = linspace(0, 0.85, N);
qp = interp1(times_pressure_recorded_at, recorded_pressures, qt);
qv = interp1(times_volume_recorded_at, recorded_volumes, qt);
plot(qv, qp);

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by