Daniel Skoog

Daniel Skoog

1696 Reputation

20 Badges

8 years, 260 days
Maplesoft
Maple Product Manager

Social Networks and Content at Maplesoft.com

Maple Application Center
Daniel Skoog is a Product Manager for Maplesoft. He holds a B.Sc. in Mathematics from Queen’s University, Canada and a M.Sc. in Financial Mathematics from Uppsala University, Sweden. Daniel joined Maplesoft in 2011 and has used his applied technical expertise of mathematics, statistics, data analysis and software design to deliver several exciting new releases. Daniel has also contributed several commands to the Maple library, having authored new routines in Statistics, Finance and data analysis.

MaplePrimes Activity


These are answers submitted by Daniel Skoog

@marc005 : You shouldn't really need to jump through these hoops to get this to work, but try:

data := "https://docs.google.com/spreadsheets/d/1L5-yUB0EWeBdJNMdELKBRmBQ1JJ0QymrtDLkVhHCVn8/pub?gid=649021574&single=true&output=csv":
ImportMatrix(data, source = delimited, delimiter=",");

Another way around it is to add a carriage return into your data file. With this empty last line, Import and ImportMatrix handle the file.

We'll look into making this happen more easily.

For export, this looks like an issue with ExportMatrix. We will file this and look into it.

For a workaround, assuming your data is floating point, try using the following to export your matrix instead:

A := Matrix(10^7,14, fill=5);

fprintf( "test.csv", "%{c,}.16e\n", A );

fclose( "test.csv" );  

This should at very least cut down the export time significantly.

You could do this using the following:

Declare your PDF as a piecewise function:

 f := x -> piecewise(0 <= x and x < 5, 1/25*x, 5 <= x and x < 10, 2/5 - x/25, 0);

Then use the Distribution command to create a new distribution:

 with(Statistics):
 MyDist := Distribution( PDF = f );

 

Then use the CDF command to get the cumulative distribution function:

 CDF(MyDist,t);

 

This option isn't available since OS X has built-in print to PDF support (File->Print->PDF->Save as PDF). For OS X, Maple uses that instead. 

The initialization file solution is good choice for a global setting, however you might also consider using a profile to house this setting.

If you're using Maple 2015, you can create a new user profile, or just modify the "EngineeringNotation" profile to use:

    interface(imaginaryunit=j):

The default profile files are found under: .../{Maple Install Directory}/profiles

Profiles are useful if you are going to send a Maple worksheet to someone because the profile code is included with the Maple worksheet, as opposed to the Maple initialization file which is global on your machine only. It's also easy to switch the default global Maple (or local worksheet) user profile, so you can run other worksheets with the default imaginary unit if so desired.

 

The online help has not been updated as of yet, but there's more on user profiles in the what's new material for Maple 2015.

You could generate a sample using the Statistics:-Sample command. The first argument is the distribution that you're sampling from and the second is the sample size.

randomize():
Statistics:-Sample( Binomial( 200, 0.9 ), 10 );

 

Maple input mode will give you 1-D math in worksheet mode as well as for any newly created execution groups in document mode. It sounds like you might benefit from changing your default format for new worksheets to 'worksheet' so that you always get a new execution group. This option can be found under the interface tab.

For anyone else interested, there is also a guide to making the Maple interface "1-D" by default linked from the following FAQ.

I would first use ImportMatrix to import the data (this is more general than the ExcelTools option and will also handle Excel files).

MyData := ImportMatrix("PathToMyData")

 

Now that you have the data, use the TimeSeries command to turn it into a Time Series object:

with(TimeSeriesAnalysis):

MyTS := TimeSeries( MyData, headers = 1, dates = 1)

 

Since you mentioned that the first column is a column of dates, we need to add the 'dates' = column number as an option such that the time series is created using your dates. Similarly adding 'headers' = 1 specifies the names of the data sets contained in the TimeSeries, in your case, this is month names.

Some TimeSeries commands will only work on one dataset of the TimeSeries at a time, so you might need to specify which column (or dataset) to work with.  To plot it for example:

TimeSeriesPlot( MyTS[..,1] ) would plot 'January'.

TimeSeriesPlot( MyTS ) would also work if you wanted to plot all months.

 

There is a good example which runs through all of these steps on the Time Series - what's new for Maple 18 page.

 

Hope that helps!

Other than exporting to PDF or other formats, if they download the free Maple Player, they can open the Maple worksheet directly.  Also with the Maple Player, if your document has any interactive components, they can interact with it.  The Maple Player is available for download here: http://www.maplesoft.com/products/maple/Mapleplayer/

Maple is not available on any mobile platforms at this time, however, you can access Maple worksheets through the MapleCloud on tablets (maple.cloud).

To do so, you would need to share your document on the cloud, see here for more details.

In Maple 18, the URL package makes it possible to get data from HTTP, HTTPS, and FTP protocols.  See the URL package page for more details.

The URL package uses the same calling sequence as the HTTP package, so your code becomes:

Path := "https://dl.dropboxusercontent.com/s/7fqalrdtn0c3r8u/Stockholm%20Stock%20Exchange%28Percentage%20Change%29.csv?token_hash=AAGxpzva90O6oNlLAie3T1h0UNP06I5EPg2qrROHMglRMw&dl=1":
URL:-Get(Path, 'timeout' = 100);

 

If you're looking to bring in CSV files, you might also try the ImportMatrix command, which can now handle URLs.

For example, here we'll grab Euro-Dollar futures from Quandl:

ImportMatrix("http://www.quandl.com/api/v1/datasets/CHRIS/CME_ED1.csv?&trim_start=1982-02-01&trim_end=2014-04-01&sort_order=desc");

There are a couple of ways to plot multiple functions on the same plot.  

As the previous commenter mentioned, we can give the plot command a list of expressions to plot:

plot([sin,cos]);

Which also works for 3D plots:

plot3d([x, sin(x)*y], x = -2*Pi .. 2*Pi, y = -5 .. 5);

If you have existing plot structures, you can combine these with the plots:-display command:

plot1 := plot(sin);
plot2 := plot(cos, color = blue);
plots:-display([plot1, plot2]);

And last but not least, you can also use the drag and drop method, see here for more details.

It is possible to view Maple worksheets through your web browser on android devices by visiting the MapleCloud hompage: http://maplecloud.maplesoft.com

Click here for details on how to share content on the cloud in Maple.

Apple has released a new version of the “Java for OS X 2013-004” update that fixes the display problems that all Java-based programs were experiencing in OS X. You can download this update through the Apple menu - Software Update or Apple App Store under the “Update” heading. This update can also be downloaded via the Apple website at:

                http://support.apple.com/kb/DL1572

 Once you have installed the update, please try to launch the Maple installer and you should be able to proceed through the install as normal.

Both of these issues, namely that it is not possible to enter a '}' in 2d math in Windows, as well as the issue with needing to press characters such as `, ^, ~, ´ twice are bugs that were introduced in 17.01 and are strictly present on international keyboards. 

We are currently working on a fix for these issues as we speak.  For the moment, workarounds include reverting back to 17.00 or using 1D math. Another workaround for the } issue in 2D is to press and hold ALT and enter the ascii code 125 using the keypad.

If anyone experiences any other strange keyboard issues with international keyboards, please let us know at support (at) maplesoft.com

5 6 7 8 9 10 11 Page 7 of 12