Hello,
I have this loop:
for !i=10 to 100 step 10
scalar ssrt_!i=sum_ssr_hdebt_!i+sum_ssr_ldebt_!i
next
I would like to know how to save the scalars that it generate, I mean ssrt_10, ssrt_11,etc in a vector and then find the minimun of that vector.
Thank you for your help.
Save scalars in a vector
Moderators: EViews Gareth, EViews Jason, EViews Moderator

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11729
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Save scalars in a vector
Code: Select all
vector(10) a
for !i=10 to 100 step 10
!j = !i/10
a(!j)=sum_ssr_hdebt_!i+sum_ssr_ldebt_!i
next
Follow us on Twitter @IHSEViews
Re: Save scalars in a vector
And is there a way to indentify which is the minimun value of that vector, I mean to identify which scalar ssrt_!i is the minimun value of that vector?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11729
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Save scalars in a vector
Follow us on Twitter @IHSEViews
Re: Save scalars in a vector
And if I want to run the loop from 1 to 100 without the step and save the 91 values in a vector? How I could conduct that?
vector(91) a
for !i=10 to 100
for !j=1 to 91
a(!j)=ssrt_!i
next
next
I have run something like this but it gives me the same value (the last ssrt_!i of the loop) in all the rows of the vector.
vector(91) a
for !i=10 to 100
for !j=1 to 91
a(!j)=ssrt_!i
next
next
I have run something like this but it gives me the same value (the last ssrt_!i of the loop) in all the rows of the vector.
Who is online
Users browsing this forum: No registered users and 1 guest