I'm looking to do something in Objective C equivalent to the following MATLAB command:
A=4:7;
In this case, the variable A then becomes an array with elements [4 5 6 7].
Is there any shorthand way to set an NSArray with a sequence of numbers like this in Objective C? Thanks for reading!
Use a NSIndexSet as the object in the array - you can then use:
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(4, 4)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With