[✓] Access elements of a QuantityArray?

Posted 1 month ago
204 Views
|
2 Replies
|
1 Total Likes
|
 Hi, How do I access the individual elements of a QuantityArray? For example, if I initialize an array: temps=QuantityArray[ConstantArray[0,5],"Kelvins"] and then I'd like to change the third element of temps to 273 K. Thanks, Tony
2 Replies
Sort By:
Posted 1 month ago
 I guess you are asking for ReplacePart, e.g. try: temps = QuantityArray[ConstantArray[0, 5], "Kelvins"]; temps = ReplacePart[temps, 3 -> Quantity[273, "Kelvins"]]; temps[[3]]