Post Reply 
fsolve question
06-19-2015, 11:37 AM
Post: #6
RE: fsolve question
Quote:Why do you guys put CAS commands inside a program? Is there a benefit?

Let's say you were pondering the ways of the world, and while admiring the beauty of the Prime's keyboard, you just happen to code in a CSP2D optimization program. Knowing that you will need some test data, (in HOME view), you simply key in the command line:

M1:=CAS("randMat(N,3,ip(1..10))");

It gets late, and another day, you pick up where you left off. In the meantime, you have cleared the calc's history, having used it for various other things. Once again, you need test data, so you key in the above, again. Perhaps again and again ... soon you decide there must be a better way to get fresh test data and Voila!: you say to yourself, "Self, I'll make a grand program to do that for me!" And you happen to make this:

Code:

EXPORT td(n)
BEGIN
N:=n;                                // pass CAS
M1:=CAS("randMat(N,3,ip(1..10))");   // Generate matrix of test data, M1[#pieces,length,width] of N patterns
END;

Realizing how much easier, and quicker, and less error prone, it is to type td(positive integer) whenever you need fresh test data, you're glad you did that, rather than that long CAS embedded HOME view command line. You soon you finish the CSP2D program, which works wonderfully, and you consider sharing it. Please do.

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


Messages In This Thread
fsolve question - roadrunner - 06-15-2015, 12:34 PM
RE: fsolve question - roadrunner - 06-15-2015, 01:19 PM
RE: fsolve question - DrD - 06-15-2015, 01:32 PM
RE: fsolve question - Angus - 06-19-2015, 10:09 AM
RE: fsolve question - DrD - 06-19-2015 11:37 AM
RE: fsolve question - DrD - 06-19-2015, 10:18 AM
RE: fsolve question - Angus - 06-19-2015, 11:53 AM
RE: fsolve question - DrD - 06-19-2015, 12:57 PM



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