Can anyone tell me what this statement is doing?
pot = 2 ## ( (n-1):0 );
If n is 3 it creates pot that equals 4 2 0.
But I don't understand the (n-1):0 indexing
The colon creates a vector of values, from (in your case) n-1 all the way down to 0, by 1.
So when n=3, this produces a vector with values
2 1 0
The colon creates a vector of values, from (in your case) n-1 all the way down to 0, by 1.
So when n=3, this produces a vector with values
2 1 0
Thank you!
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.