필터 지우기
필터 지우기

Subextract data from a matrix

조회 수: 2 (최근 30일)
Joao
Joao 2012년 3월 9일
Dear all,
I'm trying to plot some satellite data with matlab, in which I would like to subset my interest area. The problem I'm having is to subset the matrix that contains my data. I've a 3250x1325 matrix of data, and a 3250x1 vector for lon and 1325x1 for lat. Does anyone has an idea how can I subset my interest area from the data matrix?
Thanks for the help.
Cheers
Joao

채택된 답변

Walter Roberson
Walter Roberson 2012년 3월 9일
latmatches = (lat >= LowerLatBound & lat <= UpperLatBound);
longmatches = (long >= LowerLongBound & long <= UpperLongBound);
datasubset = YourMatrix(longmatches, latmatches);
  댓글 수: 2
Walter Roberson
Walter Roberson 2012년 3월 10일
You say that your matrix is 3250 x 1325, and that your lon vector is 3250 x 1. That implies that the first index in to your matrix is lon. The error message you show uses lat as the first index of the matrix.
Joao
Joao 2012년 3월 10일
I'm realy sorry. Your answer is correct.
The problem was some lines above i was using meshgrid to generate a grid to plot my SST values. I manage now to subextract my study area.
Thanks very much for your help.
Best regards

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by