Daniel Skoog

Daniel Skoog

1766 Reputation

22 Badges

14 years, 22 days

MaplePrimes Activity


These are answers submitted by Daniel Skoog


There's no one command for opening a file browser window and returning the chosen path in Maple (I'm guessing this is what you want to do with the window), but you can build one pretty easily with some Maplet code:

    FileSelector := proc()
           local result := Maplets:-Display( Maplets:-Elements:-Maplet( Maplets:-Elements:-FileDialog['_Get_File_Path'](
       'onapprove' = Maplets:-Elements:-Shutdown(['_Get_File_Path']),
       'oncancel' = Maplets:-Elements:-Shutdown(),
       'filefilter' = "*.mw",
       'filterdescription' = "Maple Worksheet(.mw)"
    )));
        if result <> NULL then
            return op( result );
        else
            return result;
        end if;
    end proc:

This procedure opens a file dialog box, asks a user to supply the give file type (see the filefilter and filedescription lines above), and returns the path to the file chosen by a user.

To get Maple to open the file, you can then use the Worksheet:-DisplayFile command:

Worksheet:-DisplayFile(FileSelector());

 

Hope this helps.

 

@John Fredsted : If the automatic update function in Maple didn't work for some reason, you can always just download the update files directly from our site: http://www.maplesoft.com/support/downloads/m2017_1update.aspx

Since you asked about the update, it does include updates to both the Maple library as well as the help system. Once installed, you will see a couple of new files in your %MapleInstallDir%/lib/ folder called update.mla and update.help. These files are usually the main part of any update and contain the library and help updates respectively. As previously mentioned, to check what version you have, you can use the version command in Maple in addition to checking the log files for any issues while installing - it sounds like in your case that the download may have failed so the installer never ran in the first place.

 

Have you tried to put your code into a CodeEditRegion? Code edit regions have optional 'Automatic Text Wrapping', which is set to false by default. There are also several other nice features in code edit regions such as syntax highlighting, bracket matching, line numbering, etc. Here's a screenshot that shows a couple of these features as well as the scroll bar for longer code sections:

Depending on your workflow, you may also find the start-up code editor useful. This shares a number of features with the code edit region, but is slightly more natural if you are writing scripts which you then execute in Maple.


This is a frequently asked question. Have a look at https://www.maplesoft.com/support/faqs/detail.aspx?sid=32673


The one big difference between workbooks and package workbooks is that package workbooks have a saved module in them. If a workbook does not have a saved module (i.e. your package), the option to upload it to the MapleCloud packages group as a package will not appear.

In order to make your workbook into a package workbook, open it, load your package module (either read it in from a text file or execute it from a worksheet in the workbook, then use the savelib command to add it to the workbook.

You can do so by running:

savelib( 'YourPackageName', "this://");

After that, save the workbook again and try to upload it - you should now have the ability to add it to the MapleCloud packages group.

I hope that helps - let me know if you have any questions.


The built-in country dataset isn't really meant to be viewed in its entirety - there's simply too much information there (126 columns by185 rows with each entry itself containing a TimeSeries (or other) data structure. A better approach is to query the data set for the specific subset of data that you want and then convert those results to something that's more easy to read.

For example, try:

data := DataSets:-Reference("Builtin","Country");
convert(data[1..3,1..3], Matrix);

 

This may be a bit too generic, so you can also query the dataset using the country names and the variables that you would like to see more about:

convert(data[["Canada","Sweden"],["Population","CPI Change"]], Matrix);

 

Once this is in Matrix form, if you need to exceed the default 10x10 display limits, you can also set interface(rtablesize) to something greater than 10.


Any content uploaded to the MapleCloud is subject to the MapleCloud Terms of Service: http://www.maplesoft.com/cloud/terms.aspx

You should read through it carefully to ensure that you are comfortable with it before uploading anything. If you are unsure about anything in the terms of service, you should definitely consult with a representative that is knowledgable about IP law for your region.

I'll also mention that I'm not a lawyer and that any of my comments are not "official" Maplesoft comments. Personally, I would pay close attention to the "Use of service by you" and "Proprietary rights" sections. Specifically, in the former section, it lists: "Users are responsible for any copyright pertaining to the content they post." To me, this reads as whatever content you upload, you should include a disclaimer or copyright notice that tells users that you are sharing your content with a license which includes attribution - i.e. they need to mention you if they are using your work. If you haven't done so already, you might also read up on creative commons licenses (or other common license frameworks) and determine what license you are most comfortable sharing your work under.

I hope that helps.

This is actually expected behaviour (though I can see how you would have reached your conclusion).

The reasoning is that when you use "Save As" on an existing Workbook, you are renaming the Workbook file on disk, not the files that it contains; the Workbook is really just a container for its content. This is probably somewhat confusing because on first Workbook creation, the worksheet that you "Save As" into a Workbook automatically gets assigned to the same name as the Workbook (rather than being untitled). Perhaps we should modify this behaviour to save the Workbook and put the cursor into editing the name of the worksheet that is now a file inside of the Workbook.

So then, since "Save As" does not affect the internal filenames inside the Workbook, that's why you'll still have the same filename inside of the Workbook, but the originating filepath (the Workbook name) will have changed.

We did spend some time considering this use case and did determine that it was risky to throw away any of the internal filenames on "Save As". We felt that adding the ability to manually change attached filenames via the Workbook navigator was the best path to fixing any of these concerns.

I hope that clarifies the behaviour. If you have any other concerns or feedback on Workbooks, please feel free to post those here or to contact us directly at support (at) maplesoft.com

There isn't a command like Student:-Statistics:-ProbabilityTable or Student:-Statistics:-CriticalTable that does this automatically, but it's relatively easy to built it. Here are two examples:

First, we declare a function to generate values for the inverse CDF of the standard Normal distribution:

INVCDF := x -> Statistics:-Quantile(Normal(0,1), x):

 

The first way of doing this is by using a uniform range of values from 0.50 to 0.99.

Here's a nicely displayed DataFrame that prints out the values (this matches most closely to the table generated by the ProbabilityTable command):

df := DataFrame(Array([seq([seq(INVCDF(i+j), i=0.00..0.09, 0.01)], j=0.5..0.9, 0.1)]),
                         columns=[seq(0.00..0.09, 0.01)], rows=[seq(0.5..0.9, 0.1)]):
interface(displayprecision=4):
Tabulate(df):

 

Note that I've set the display precision to 4 in order to clean up the displayed table.

 

In a later post, the OP gives a link to another version of this table that adds in some other values (0.991 to 0.999, and 0.975). Here's an alternative version that will include those values:

values := Array([op({seq(0.50..0.99, 0.01), seq(0.991..0.999, 0.001), 0.975})]):
values := ArrayTools:-Reshape(values, [10,6]):
DocumentTools:-Tabulate(<seq(op([values[..,i], INVCDF~(values[..,i])]), i=1..6)>^%T, interior=none):

 

This uses the DocumentTools:-Tabulate command (rather than the DataFrame's Tabulate export) and prints the same as the requested table.

Hope this helps.

The only way to display annotations on plots (as of Maple 2016) is by using the point probe: http://www.maplesoft.com/support/help/Maple/view.aspx?path=worksheet/plotinterface/pointprobe

Since you mentioned "information", I'm guessing that you are looking for more than just cursor position or nearest point coordinates though, which is something that is not currently possible, but would make a nice addition in a future release.

@Christopher2222 I've filed an internal bug for this issue. Thanks for bringing it to our attention.

Numeric Formatting is only a display layer, so you don't need to worry about any loss of precision in your computations.

To turn it off (or on), put your cursor somewhere in the document block containing your computations and go to the Format menu and choose Numeric Formatting. Set it to None and Apply it.

If it keeps reappearing, then you may have clicked Apply and Set as Default, which means to turn it off, you have to repeat these steps but choose None and Apply and Set as Default.

One more note about numeric formatting, as you can see in your picture, numeric formatting is applied to all lines in a document block. If you wanted to use numeric formatting on only one line, you would need to separate your code into separate document blocks (lines) and then apply the desired numeric formatting.

Hope that helps.

2 3 4 5 6 7 8 Last Page 4 of 12