MATLAB Answers

0

How to convert data file from grid-format(lat,lon, time) into a table

HN 님이 질문을 제출함. 26 May 2019
최근 활동 HN 님이 댓글을 추가함. 28 May 2019
I have downloaded precipitation file of U Delaware Dataset in .nc format and opened with the ncread. This file is as follows precip 720×360×1416 Including Lat(360×1), Lon (720×1) and Time(1416×1) for 1901/01-2017/12.
I want to change this file to a table for any year as follows
  1. Cordinate file 2592200×2
  2. Data file 12×2592200
where
720×360=2592200

  댓글 수: 0

로그인 to comment.

답변 수: 1

KSSV 님의 답변 27 May 2019
 채택된 답변

x = 1:10 ;
y = 1:5 ;
[X,Y] = meshgrid(x,y) ;
A = rand(5,10,10) ;
% repeat spatial matrix
X = repmat(X,1,1,10) ;
Y = repmat(Y,1,1,10) ;
iwant = [X(:) Y(:) A(:)]

  댓글 수: 1

로그인 to comment.



Translated by