Create an irregular step Array

Source: Internet
Author: User

;
; Set an array with a step of 1./60. The minimum value of the array is [-3., 3.].
; BenProgramTwo methods are set, one is simple, and the other is case... of..., which also reflects the perfection of IDL.

Pro test_case
; The Fist Manager
Data = make_array (360)
For I = 0,359 do begin
Case I
0: Data [0] =-1, 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.