PatrickT

Dr. Patrick T

2108 Reputation

18 Badges

16 years, 302 days

MaplePrimes Activity


These are replies submitted by PatrickT

@acer 

thanks acer!

@acer 

thanks acer!

thanks acer for this workaround!

I had tried width and height instead of axiswidth and axisheight, but I didn't know about omitting the units!

indeed, width and height are good enough.

It took me a little while to get it to work though, because I initially missed a 'subtle' difference between my old code and your new one: the double-quotes don't work!

'plotoptions' = `color,landscape,noborder,transparent,width=512,height=320`: works as you stated

'plotoptions' = "color,landscape,noborder,transparent,width=512,height=320": doesn't work here


thanks acer for this workaround!

I had tried width and height instead of axiswidth and axisheight, but I didn't know about omitting the units!

indeed, width and height are good enough.

It took me a little while to get it to work though, because I initially missed a 'subtle' difference between my old code and your new one: the double-quotes don't work!

'plotoptions' = `color,landscape,noborder,transparent,width=512,height=320`: works as you stated

'plotoptions' = "color,landscape,noborder,transparent,width=512,height=320": doesn't work here


worked flawlessly here, easy to install, great package thanks!

Resizing plots programmatically is a frequently requested feature. A great add-on.


### Query the intallation folder location:
cat(kernelopts(homedir),"/maple/toolbox/Resize") ;
            "C:\Users\patrick/maple/toolbox/Resize"

### An example of use is found here:
cat(kernelopts(homedir),"/maple/toolbox/Resize/Examples/Resized_plots.mw") ;
"C:\Users\patrick/maple/toolbox/Resize/Examples/Resized_plots.mw"

### Install acer's Package "Resize_installer.mla"

march( 'open', "C:/tmp/Resize_installer.mla");

@Alejandro Jakubi 

yes indeed... in the old mapleprimes there was a section devoted to suggestions and reports about bugs and ideas for development, it would be useful to have a section like that again, in my opinion...

thanks acer, thanks pvrbik,

trunc does the trick, indeed, e.g. TransitionFrom := state -> states[ trunc( Sample( dist[state], 1)[1] ) ];

I'm embarrased to say that I had tried to use convert(,rational) but couldn't make it to work on an entire list (though I thought I'd seen it done before).

It does make sense here to have floats.

thanks acer, thanks pvrbik,

trunc does the trick, indeed, e.g. TransitionFrom := state -> states[ trunc( Sample( dist[state], 1)[1] ) ];

I'm embarrased to say that I had tried to use convert(,rational) but couldn't make it to work on an entire list (though I thought I'd seen it done before).

It does make sense here to have floats.

I chanced upon this thread looking for related info. I can't get any of the suggestions to work. I'm using Maple 15 on Windows7-64.

for instance,

with(Statistics):
P1:= [[.6,.3,.1],[.4,.5,.1],[.3,.4,.3]]:
X:= [seq(Sample(ProbabilityTable(P1[i]),51),i=1..3)]:
R:= Array(1..51):
R[1]:= 1:
for j from 2 to 51 do R[j]:= X[R[j-1]][j] end do:
S:= cat(op(convert(subs(1="S",2="C",3="R",R),list)));

Error, invalid subscript selector
S := "S" || (1.) || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0

interface(rtablesize=100);
X;
subs(1="S",2="C",3="R",R);
[[2., 1., 1., 1., 2., 1., 1., 1., 1., 2., 2., 3., 1., 1., 1., 1., 

  1., 1., 1., 1., 1., 1., 2., 1., 1., 1., 3., 1., 1., 1., 3., 1.,

  1., 2., 3., 2., 1., 2., 2., 1., 3., 1., 1., 1., 2., 1., 1., 3.,

  2., 2., 1.], [1., 2., 1., 2., 3., 2., 2., 2., 1., 1., 2., 2.,

  3., 3., 1., 2., 1., 3., 1., 1., 2., 2., 1., 1., 2., 2., 2., 1.,

  2., 2., 1., 1., 2., 1., 2., 2., 2., 2., 2., 1., 1., 2., 1., 1.,

  2., 3., 2., 2., 2., 2., 2.], [2., 3., 1., 1., 1., 3., 1., 1.,

  1., 2., 3., 2., 1., 3., 1., 3., 1., 1., 1., 2., 2., 3., 1., 1.,

  2., 3., 2., 1., 3., 3., 3., 2., 1., 2., 1., 1., 2., 3., 3., 1.,

  3., 2., 3., 3., 2., 1., 3., 1., 2., 2., 3.]]
["S", 1., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

  0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

The entries of the X and R Arrays are floats, could that be interfering?

 

 

As for the other suggestion below, I get:

Error, (in TransitionFrom) invalid subscript selector

I chanced upon this thread looking for related info. I can't get any of the suggestions to work. I'm using Maple 15 on Windows7-64.

for instance,

with(Statistics):
P1:= [[.6,.3,.1],[.4,.5,.1],[.3,.4,.3]]:
X:= [seq(Sample(ProbabilityTable(P1[i]),51),i=1..3)]:
R:= Array(1..51):
R[1]:= 1:
for j from 2 to 51 do R[j]:= X[R[j-1]][j] end do:
S:= cat(op(convert(subs(1="S",2="C",3="R",R),list)));

Error, invalid subscript selector
S := "S" || (1.) || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 ||

  0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0

interface(rtablesize=100);
X;
subs(1="S",2="C",3="R",R);
[[2., 1., 1., 1., 2., 1., 1., 1., 1., 2., 2., 3., 1., 1., 1., 1., 

  1., 1., 1., 1., 1., 1., 2., 1., 1., 1., 3., 1., 1., 1., 3., 1.,

  1., 2., 3., 2., 1., 2., 2., 1., 3., 1., 1., 1., 2., 1., 1., 3.,

  2., 2., 1.], [1., 2., 1., 2., 3., 2., 2., 2., 1., 1., 2., 2.,

  3., 3., 1., 2., 1., 3., 1., 1., 2., 2., 1., 1., 2., 2., 2., 1.,

  2., 2., 1., 1., 2., 1., 2., 2., 2., 2., 2., 1., 1., 2., 1., 1.,

  2., 3., 2., 2., 2., 2., 2.], [2., 3., 1., 1., 1., 3., 1., 1.,

  1., 2., 3., 2., 1., 3., 1., 3., 1., 1., 1., 2., 2., 3., 1., 1.,

  2., 3., 2., 1., 3., 3., 3., 2., 1., 2., 1., 1., 2., 3., 3., 1.,

  3., 2., 3., 3., 2., 1., 3., 1., 2., 2., 3.]]
["S", 1., 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

  0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

The entries of the X and R Arrays are floats, could that be interfering?

 

 

As for the other suggestion below, I get:

Error, (in TransitionFrom) invalid subscript selector

I see, I've never used that. How about posting your worksheet?

I see, I've never used that. How about posting your worksheet?

@Joe Riel 

Oh that's tidier.

ba,bu := kernelopts(bytesalloc),kernelopts(bytesused):
RecordEventDates(Sol,t1):
kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;

and that compares favourably with my earlier, rather contrived attempt,

@Joe Riel 

Oh that's tidier.

ba,bu := kernelopts(bytesalloc),kernelopts(bytesused):
RecordEventDates(Sol,t1):
kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;

and that compares favourably with my earlier, rather contrived attempt,

@Allan Wittkopf 

I get it!

This has been a very productive exchange for me,

thanks Allan

First 37 38 39 40 41 42 43 Last Page 39 of 93