Post Reply 
Program help needed
11-22-2014, 03:53 PM
Post: #3
RE: Program help needed
(11-22-2014 01:44 PM)Han Wrote:  [quote='DrD' pid='21758' dateline='1416663364']
1. Can the above program be constructed to return the {x,y} result? --> [-3*y^3+2*x,-9*x*y^2]

Use mat2list(). It will give you a list of components with comma separators (but it won't be a vector in the normal sense).

Sorry, Han, I was asking: (in terms of the list variables), "how can I get the program (top post) to produce the same result as grad(x^2-3*x*y^3,{x,y}); does when it's manually entered in the CAS view entry line?" grad(x^2-3*x*y^3,{x,y}); --> [-3*y^3+2*x,-9*x*y^2]

Specifically, the program line: return grad(x^2-3*x*y^3,{x,y}); crashes at run-time due to it's variables being auto-initialized to 0. (It's a CAS command vs. non-CAS program thing.)

Thanks for your help!

AND thanks also, to Joe for pointing out that unchecking the "Textbook Display" on pg 2 of Home settings, FIXES the lack of "comma separation in the vector" problem! Otherwise the result of the above example would display like: [-3*y^3+2*x -9*x*y^2] and that's just not good!

-Dale-
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Program help needed - DrD - 11-22-2014, 01:36 PM
RE: Program help needed - Han - 11-22-2014, 01:44 PM
RE: Program help needed - DrD - 11-22-2014 03:53 PM
RE: Program help needed - Han - 11-22-2014, 06:04 PM
RE: Program help needed - DrD - 11-22-2014, 08:34 PM
RE: Program help needed - Han - 11-22-2014, 09:02 PM
RE: Program help needed - DrD - 11-22-2014, 11:29 PM
RE: Program help needed - Han - 11-23-2014, 12:50 AM
RE: Program help needed - DrD - 11-23-2014, 03:25 PM
RE: Program help needed - Han - 11-23-2014, 05:32 PM
RE: Program help needed - DrD - 11-24-2014, 12:07 PM
RE: Program help needed - Han - 11-24-2014, 01:43 PM



User(s) browsing this thread: 4 Guest(s)