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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.