HP Prime SIZE and OBJ-> with matrices/vectors/lists « Next Oldest | Next Newest »

 ▼ Helge Gabert Member Posts: 113 Threads: 20 Joined: Sep 2013 09-27-2013, 04:58 PM Two questions: 1) I'm writing a program for the HP Prime where I would like to get the dimensions for an nxm matrix (user inputs the matrix). On the 50g, I can use SIZE and I'll get the dimensions as a list {n m}. On the Prime, I only get the row dimensions n. Any idea on how to get the column dimensions as well? Thanks. 2) Also, the 50G has the command OBJ->, spitting out all the elements (plus the dimensions) of matrices, vectors, or lists onto the stack. On the Prime, do I need to write a program to achieve this (basically, calling each element in a loop)? That's what I need SIZE for - - see above. Thanks again! ▼ iconmaster Junior Member Posts: 13 Threads: 0 Joined: Sep 2013 09-27-2013, 05:21 PM 1) Try rowDim and colDim. 2) The programming language does not work on a stack, so an OBJ-> equivalent would be almost useless. Simply call each element in sequence. ▼ Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 09-27-2013, 05:29 PM 1) SIZE on a matrix here seems to return { r, c } ??? 2) m1(r,c) for direct access/storage. TW ▼ Helge Gabert Member Posts: 113 Threads: 20 Joined: Sep 2013 09-27-2013, 05:41 PM Yes, in home view you get {n m}, but not in CAS view (only n). This brings up an interesting question - - if the user runs the program in home view vs. CAS view, are there possible inconsistencies to contend with? ▼ Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 09-27-2013, 05:52 PM Quote: Yes, in home view you get {n m}, but not in CAS view (only n). This brings up an interesting question - - if the user runs the program in home view vs. CAS view, are there possible inconsistencies to contend with? Probably because in CAS it's treated as a "vector of vectors" (with which I disagree). ▼ Helge Gabert Member Posts: 113 Threads: 20 Joined: Sep 2013 09-27-2013, 05:55 PM Thanks for the insight . . . that would explain it . . . but then you HAVE to be in home view for things to work properly, or not? ▼ Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 09-27-2013, 06:19 PM No, the programs created normally in the program catalog are numerical in nature. Thus any call to "size" will be the correct one - whether called from the CAS or anywhere else. CAS functions can be created, but currently only by manually creating them in the CAS environment. eg: myfunc(a,b,c):=begin a+b+c; end; [ENTER] TW ▼ Helge Gabert Member Posts: 113 Threads: 20 Joined: Sep 2013 09-27-2013, 06:56 PM OK Thanks! Helge Gabert Member Posts: 113 Threads: 20 Joined: Sep 2013 09-27-2013, 05:44 PM Yes that works. Thanks for rowDim and colDim!

 Possibly Related Threads... Thread Author Replies Views Last Post HP Prime Matrices curiosity bluesun08 0 1,053 12-09-2013, 06:44 PM Last Post: bluesun08 [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 1,454 12-07-2013, 07:15 PM Last Post: CompSystems HP Prime: Lists in programs Alberto Candel 7 2,548 12-04-2013, 02:16 AM Last Post: Alberto Candel HP Prime: matrices in programs, in need of help Alberto Candel 9 2,282 11-26-2013, 01:33 AM Last Post: cyrille de Brébisson [Prime]Passing lists as arguments Andy Gryc 2 1,011 11-18-2013, 10:16 PM Last Post: Andy Gryc HP Prime equivalent of OBJ-> ? John Colvin 2 1,011 11-18-2013, 07:48 PM Last Post: John Colvin Prime: Program size limited to 64K? Erwin Ried 4 1,407 11-17-2013, 11:42 PM Last Post: Joseph Ec HP 50g - question about matrices arrays vectors etc. Sean Freeman 6 1,798 11-14-2013, 01:44 PM Last Post: peacecalc hp prime - programming with lists giancarlo 3 1,301 11-10-2013, 02:13 AM Last Post: Giancarlo Prime: size display bug when editing large programs BruceH 2 1,002 10-31-2013, 05:30 PM Last Post: BruceH

Forum Jump: