<div dir="ltr">Hi Ipshita,<div><br></div><div>try adding this line before your trend analysis loop:</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">;=============================</span><span style="font-family:arial,sans-serif;font-size:13px">============</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">;Doing trend analysis</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">;=============================</span><span style="font-family:arial,sans-serif;font-size:13px">============</span><br style="font-family:arial,sans-serif;font-size:13px">

<br>z = new(12,&quot;float&quot;)<br><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">do nmo=0,11</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">    z(nmo)=regline(years,air(:,</span><span style="font-family:arial,sans-serif;font-size:13px">nmo))</span><br style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">end do</span><br></div><div><br></div><div>The error you are getting is likely due to the fact that you didn&#39;t define the variable z before you try to access it.</div>

<div><br></div><div>Hope this helps,</div><div>Maria</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 31, 2014 at 5:36 PM, Ipshita Majhi <span dir="ltr">&lt;<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br>I am interested in the following steps:-<br></div>1) I have a 2 D matrix where there are 133 rows and 12 columns called air<br>

</div>2) I want to c alculate trend between years which go row 1880:2012 and eachcolumn of air. <br>
</div><div>3) Error is unidentified z<br></div><div><br><br>;======================================<br>; create year<br>;======================================<br><br>  years=ispan(1880,2012,1)<br>  <br>;======================================<br>


; read data; add some meta data<br>;======================================<br><br>  diri   = &quot;~/Documents/PhD_June_2015/Data_AIR/&quot;<br>  fili   = &quot;air.txt&quot;<br>  air    =  readAsciiTable(diri+fili, nmos, &quot;float&quot;,2)<br>


  air@_FillValue = msg<br><br>  air@long_name = &quot;All India Precip&quot;<br>  air@units     = &quot;mm&quot;<br>                ; <br>  opt = True<br>  opt@fout = &quot;all_india_data&quot;<br><br>  write_matrix(air, nmos+&quot;f7.2&quot;, opt)<br>


;=========================================<br>;Doing trend analysis<br>;=========================================<br><br>do nmo=0,11<br>    z(nmo)=regline(years,air(:,nmo))<br>end do<br>  <br></div>;======================================<br>


; create year<br>;======================================<br><br>  years=ispan(1880,2012,1)<br>  <br>;======================================<br>; read data; add some meta data<br>;======================================<br>


<br>  diri   = &quot;~/Documents/PhD_June_2015/Data_AIR/&quot;<br>  fili   = &quot;air.txt&quot;<br>  air    =  readAsciiTable(diri+fili, nmos, &quot;float&quot;,2)<br>  air@_FillValue = msg<br><br>  air@long_name = &quot;All India Precip&quot;<br>


  air@units     = &quot;mm&quot;<br>                ; <br>  opt = True<br>  opt@fout = &quot;all_india_data&quot;<br><br>  write_matrix(air, nmos+&quot;f7.2&quot;, opt)<br>;=========================================<br>;Doing trend analysis<br>


;=========================================<br><br>do nmo=0,11<br>    z(nmo)=regline(years,air(:,nmo))<br>end do<br>  <br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>