`
mywebcode
  • 浏览: 1000112 次
文章分类
社区版块
存档分类
最新评论

不规则步长数组创建

 
阅读更多

;
;;设置一个步长为1./60的数组,其数组的最小做大值为[-3.,3.]
;;本程序设置了两个方法,一个简单的设置,一个采用case...of...,同样体现idl的完美


pro test_case
;the fist manager
data = make_array(360)
for i =0,359 do begin
case i of
0: data [0] = -3.0
359: data[359] = 3
else: data[i]= data[i-1]+1./60
endcase
endfore
;the second one
data_a = Findgen((3-(-3))*60)/60.0-3.0

openw,lun,'D:\test\test.txt', /GET_LUN
printf,lun,data
printf,lun,'***********************************'
printf,lun,data_a
free_lun,lun
end


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics