Post Reply 
Program help needed
11-22-2014, 09:02 PM (This post was last modified: 11-22-2014 09:06 PM by Han.)
Post: #6
RE: Program help needed
(11-22-2014 08:34 PM)DrD Wrote:  Before asking for help, I tried encapsulating the variables in 'single' quotes, without success.

Using "double" quotes works, though, and I'll make note of that. The notion of single quotes came from previous posts, where things like the quote() function seemed to solve similar problems. Help says the quote() function, used with Sto, to save a function in a variable; but it is clearly not the same as double quotes!

I did try mat2list, but it doesn't work in certain cases with or without Textbook Display checked:

comma separated:
mat2list(grad(x^2-3*x*y^3,{x,y})) ---> {-3.*y^3+2.*x,-9.*x*y^2}

no comma's:
mat2list( [-3*y^3+2*x -9*x*y^2] ) ---> {-9*x*y^2-3*y^3+2*x}

I was looking for a setting to provide comma separation, and the checkbox was just the ticket for that.

It's not the smoothest interface, but if it works, that's a good thing!

Thank you!

-Dale-

It looks like in your second example, you fed mat2list() a vector consisting of only one element (so the result is also a 1-element list). In algebraic entry, you are require to use a comma to separate entries in a vector [a,b,c]. So [a b c] would cause the calculator to complain. Likewise for textbook mode, except pressing comma places a space between entries. If, on the other hand, you manually type in a space, you will generally receive a syntax error. However, if you type something like:

[-3*y^3+2*x (space) -9*x*y^2 ]

and the minus sign in front of the 9 is the subtraction symbol, then you haven't created 2 entries. What looks like a 2-entry vector is actually a single entry -- the CAS gracefully handles spaces inside an algebraic expression as if they aren't there. You can test this by using the size command.

Graph 3D | QPI | SolveSys
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: 1 Guest(s)