Alex Potapchik

16 Reputation

4 Badges

15 years, 153 days

MaplePrimes Activity

These are answers submitted by Alex Potapchik

Could you provide an example? Thanks, -Alex, Maplesoft
Another useful help page is ?OpenMaple,Java,Algebraic which describes the com.maplesoft.openmaple.Algebraic class -Alex
You can try something like this: > restart; piecewise(piecewise(a < 1, true, false) = true, 1, 0); { { true a < 1 { 1 { = true { { false otherwise { { 0 otherwise Or you can use delayed evaluation to display the function. > restart; 'piecewise'('piecewise'(a < 1, true, false), 1, 0); { { true a < 1 { 1 { { { false otherwise { { 0 otherwise This does not look good in the tty version but looks OK in the gui. Alex Potapchik, Maplesoft
Compile := proc(src::string, dll::string) local mpldir, cmpcmd, lnkcmd, res; mpldir := "C:\\PROGRA~1\\MAPLE1~1"; cmpcmd := sprintf("wcl386 -c -bd -D_MSC_VER %s.c -fo=%s.obj", src, src); lnkcmd := sprintf("wlink system nt_dll libpath %s\\ library maplec.lib file %s name %s", mpldir, src, dll): res := ssystem(cmpcmd); printf("%s\n", res[2]); res := ssystem(lnkcmd); printf("%s\n", res[2]); NULL; end proc:
type(x, type1 and type2) will return true if x is of the form a and b where a is of type type1 and b is of type type2. Similarly, type(x, not type3) will return true if x is of the form not c, where c is of type type3. Consider: > type(x and Pi, symbol and name); true > type(not Pi, not constant); true > type(x and not Pi, symbol and not name); true This is type 'And' and 'Not' should be used. More information is available under ?type,structured
The following will print the list of all items in the drop down box. > MyPrint := proc() print(Maplets:-Tools:-Get('DDB1'('itemlist'))[1..-1]) end proc: > with(Maplets[Elements]): > maplet := Maplet([ > ["Pick your favorite Canadian city: ", DropDownBox['DDB1']("Regina", sort([ "Waterloo", "Ottawa", "Victoria", "Edmonton", "Regina", "Winnipeg", "Toronto", "Quebec City", "Fredericton", "Halifax", "Charlottetown", "St. John's", "Whitehorse", "Yellowknife", "Iqaluit" ], lexorder))], [ Button("OK", Evaluate('function' = 'MyPrint')), Button("Cancel", Shutdown()) ] ]):
plots[plotcompare] is one way to visually compare two expressions.
Page 1 of 1