sincronyzing 2 matrixes

조회 수: 2 (최근 30일)
Robert
Robert 2011년 9월 15일
Hello Matlab users,
So, I have a matrix called Temperature(238,132,35)and another Bathymetry(238,132). The Bathhymetry x and y are almost the same at Temperature matrix, with a slight little difference. Is there a way to arrange my Temperature matrix exactly over the Bathhymetry one?
P.S. I can't call the Temperature vectors independently so meshgrid is not that good. The bathymetry contains the depth at certain latitudes and longitudes, the temperature contains the temperature at certain (little different) latitudes and longitudes, so I need somehow to make those latitudes and longitudes the same...
Thank you.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2011년 9월 15일
  • Tlat - vector latitude for matrix Temperature.
  • Tlon - vector longitude for matrix Temperature.
  • Blat - vector latitude for matrix Bathymetry.
  • Blon - vector longitude for matrix Bathymetry.
[tx ty] = meshgrid(Tlat,Tlon)
[bx by] = meshgrid(Blon,Blat)
BathymetryInLatLonTemp = interp2(bx,by,Bathymetry,tx, ty)
  댓글 수: 1
Robert
Robert 2011년 9월 15일
Thank you, but I can't access individual vectors of Temperature. Is there any way to do this directly with the matrix? not being able to access the individual vectors is the main reason that I have this problem.

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

Community Treasure Hunt

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

Start Hunting!

Translated by