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!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.