Matrix to netcdf file

Hello everyone, I'm trying to make a mask, which means I want to create a matrix of 0's an 1's and put de 1's on an especific region.
I am using 180[-90:1:90] latitudes and 360[0:1:360] longitudes. I have created the matrix but I'm unsure on how to make it on the netcdf file. This is the region:
clc;
clear all;
lat = 180;
lon = 360;
data = zeros([180,360]);
data(62:62,259:260) = 1;
data(63:63,258:260) = 1;
data(64:64,258:261) = 1;
data(65:65,257:263) = 1;
data(66:66,257:262) = 1;
data(67:67,254:262) = 1;
data(68:68,255:262) = 1;
data(69:69,256:263) = 1;
data(70:70,255:263) = 1;
data(70:70,255:263) = 1;
data(71:71,256:264) = 1;
data(72:72,257:265) = 1;
data(73:73,259:269) = 1;
data(74:74,262:269) = 1;
data(75:75,268:268) = 1;
any ideas are welcomed, thank you.

Answers (0)

Asked:

on 29 Sep 2017

Edited:

on 29 Sep 2017

Community Treasure Hunt

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

Start Hunting!