acer

17267 Reputation

29 Badges

14 years, 108 days

On google groups. (comp.soft-sys.math.maple and sci.math.symbolic)

On stackoverflow.

On math.stackexchange.com.

MaplePrimes Activity


These are replies submitted by acer

Do you have the context-panel open on the right? Is the behavior the same if you close it?

@Kitonum This code relies on ListTools:-Collect for its crucial task of tallying the data, a command which was introduced only in Maple 2017.

In contrast, the Statistics:-Tally command predates that by many years, and its output can be quite easily used to form the coordinate pairs obtained from ListTools:-Collect even if more general plotting is wanted.

In Maple 2016 these get me a similar effect:

with(Statistics):
L := [1,2,2,2,3,3,4,4,5,5,6,6]:

Statistics:-Histogram( L, binwidth=1-1e-9,
                       view=[min(L)-1..max(L)+1,0..0.3],
                       xtickmarks=[{L[]}[]] );

Statistics:-Histogram( L, binbounds=[seq(min(L)-0.5..max(L)+0.5)],
                       view=[min(L)-1..max(L)+1,0..0.3],
                       xtickmarks=[{L[]}[]] );

T := table(Tally(L,output=list),sparse):
S := {L[]}:
LL := [seq(i=T[i]/nops(L),i=min(S)..max(S))]:
ColumnGraph(LL, datasetlabels=none,
            offset=0.5, distance=0.0, width=1.0,
            view=[min(L)-1..max(L)+1,0..0.3],
            xtickmarks=[seq(i,i=min(S)..max(S))]);

hist_2016.mw

@Adam Ledger No, you most certainly did not mention that the argument in the call to ListDirectory (ie, the currentdir() value) was supposed to be the same folder as you were trying to access on the H drive. Go back and read your own Question. You didn't explicitly assert that, and (in part because ImageTools:-Read expects a file name) it is a stretch to claim that it was implied. Perhaps you could reflect on the fact that your questions are often unclearly phrased.

The ImageTools:-Read command expects the name of an image file (or a URL that points at such). But now you seem to be suggesting that you are passing it the name of a folder. And you are not using any filename extension in the string. Don't you see how this confusion makes the precise name of the image file a central concern here?

You still have not told us the fully qualified name of the image file you want to read. You claim that it is "not really relevant". I suggest that it could be intrinsically useful in figuring out the causes of your problem -- even if one cause is something other than the file's name.

 

Why would you post such a question without precisely stating the full location and name of the image file which you are trying to read?

How does that call to ListDirectory have anything to do with your call to Read?

Why are you starting off the string with an escaped backslash?

@Rouben Rostamian  The two reasons why you cannot assign to the entries outside the stated bands of your Matrix B is that it is prevented by its indexing function (ie, the band[0,1] shape) and the absence of the corresponding off-band storage. The indexing function is the primary reason, as the attempted off-band assignment hits that restriction first.

The BandMatrix command can still be used to create a Matrix with the specified entries, and to which off-band entries can be assigned. Eg,
  LinearAlgebra:-BandMatrix([[0],[$1..N]],0,N+1,storage=rectangular,shape=[])
This is somewhat longer than calling the Matrix command with its scan option, naturally.

band_comment.mw

 

The four techniques that Carl laid out in his Answer can be accomplished (in essence) in versions back to Maple 6 (2000).

A few modifications would be necessary for some of them. For example the 3rd could be done by calling a module export, since the ModuleApply functionality appeared in Maple 9.5 (2004). And, while thisproc functionality appeared in Maple 14 (2010), the 4th can be implemented using option remember. And so on.

I will mention that one can programmatically manipulate the cache table of a procedure defined with option cache. So it is possible to add persistent entries to procedures even while the cache table manages other values up to some specified size as temporary. The Help page for topic CacheOption illustrates this with explicit examples, where op(4,...) is used to refer to the cache table of such a procedure. Indeed the text states, "Permanent entries can be inserted into a cache table by using the AddPermanent command.   This allows cache remember tables to still be used for base cases in recursive functions and for storing commonly used values."

Have you considered using the Calendar package (new in Maple 2018)?

This kind of thing was shown in this old response on this site, from the year 2006.

@Stretto Yes, your point was already clear.

@Carl Love I understood what you meant. But I often get a scenario in which the Maple GUI's buttons and icons (and its X, etc) don't respond while closing with the desktop's controls somehow still triggers the Maple GUI to prompt me for a worksheet-save.

So I guess that it might help someone, to be able to try both, in some situations.

(I've edited my answer, as I realize now that I mistakenly made it seem like we were talking about the same control widgets, sorry.)

I'll add that I always open every worksheet in a standalone Maple GUI session, so that a crash of kernel or GUI can only ever affect a single opened file. And since I only have a single sheet opened per GUI instance, the GUI doesn't show me the X of which you were speaking. That is, I open a wholly separate GUI instance for each concurrently open worksheet.

So, this somewhat usual crash scenario for me is where the kernel crashes and the GUI's File Close/Open from the menubar are grayed out and inoperative. It is at that juncture that closing with the desktop widget still prods the Maple GUI to prompt for a Save -- which is better than my killing the process outright.

@ddaigle321 Two lists are not identical just because they might be "mathematically" equal.

Two lists are identical under evalb if they have the same memory address (see the addressof command). That is generally not the same thing as being mathematically equal -- the definition of which varies with the mathematical domain.

Perhaps see also the verify command, and in particular verify,list help topic. To compare two lists L1 and L2 as being "mathematically" equal under a general "mathematical" verification ver one could use the command,
   verify(L1, L2, list(ver))

Somewhat similar remarks may be had about sets.

Of course it is quite possible that the elements of your lists will also be identical, in which case evalb testing would suffice. We can't tell, because you won't disclose the details of what you're actually trying to accomplish.

@Carl Love Yes, I was addressing only the original Question's literal text, not your Answer.

You mentioned writing your own function with the short name RPF, with which you could wrap each plot. But that's exactly what setPlotSize does, and you can easily rename that at will (and give it default values).

I'm not talking about making things fully automatic, especially for 3D plots. But the part of your Question about writing any additional wrapping function simply doesn't add up.

On the other hand, I think that your need and expectation of a convenient way to set both default 2D and 3D plot size is very sensible.

I can think of a few ways to accomplish that, but I'm not sure which would be best, both long term and/or as quick fix. (Eg. alter behavior of plots:-setoptions, ask for new interface settings, alter PLOT/PLOT3D printing, alter individual plotting commands, etc). For a one-off quick fix it might be simplest to alter the printing... I might have time for that.

Your question does not make sense.

Please explain clearly what you are trying to do.

1 2 3 4 5 6 7 Last Page 1 of 397