Getting Discrete Data from an x-y Plot

3 vues (au cours des 30 derniers jours)
robin mooney
robin mooney le 19 Déc 2011
Hi,
I have data from an experiment and I can plot the Temperature Vs Time for a thermocouple (where the data is recorded every 22secs approx. for about 3000secs)
However, I want to look up the value of the Temperature at discrete times from 0-3000secs in steps of 0.5 secs, and generate and array from this.
I have looked at the c2d function in Matlab but maybe there is a more straight forward way?
Can anyone help?
Many Thanks,
Robin

Réponse acceptée

Wayne King
Wayne King le 19 Déc 2011
Hi Robin, you can interpolate to a finer grid.
X = 0:10; V = sin(X);
stem(X,V);
Xq = 0:.25:10;
Vq = interp1(X,V,Xq);
figure;
plot(X,V,'o',Xq,Vq)
Although, you're considering a particularly large refinement here from 22 seconds down to 0.5 seconds, so depending on how fast the temperature data is varying, the interpolation might be that good.
  1 commentaire
robin mooney
robin mooney le 19 Déc 2011
That worked just great Thanks Wayne!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interpolation dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by