Christopher2222

5785 Reputation

24 Badges

16 years, 350 days

MaplePrimes Activity


These are answers submitted by Christopher2222

Using the picture roman_pearce gave us, I broke it up into 3 parts and saved them as a 320x500 pixel jpg image and had maple read in the images.  I couldn't get my loop to work so I'll show the long form

with(ImageTools):
with(plots):
a1:=Read("f:/1.jpg"):
a2:=Read("f:/2.jpg"):
a3:=Read("f:/3.jpg"):
b1:=ToGrayscale(a1):
b2:=ToGrayscale(a2):
b3:=ToGrayscale(a3):
c1:=convert(b1,Matrix):
c2:=convert(b2,Matrix):
c3:=convert(b3,Matrix):
d1:=Scale(c1,1/8):  #Need to scale for listdensityplot otherwise will recieve error for length exceeds 1000000
d2:=Scale(c2,1/8):
d3:=Scale(c3,1/8):
e1:=listdensityplot(d1):
e2:=listdensityplot(d2):
e3:=listdensityplot(d3):
to3d1:=plottools:-transform((x,y)->[x,y,0]):
to3d2:=plottools:-transform((x,y)->[x,y,1]):
to3d3:=plottools:-transform((x,y)->[x,y,2]):

display(to3d1(e1),to3d2(e2),to3d3(e3),transparency=0.1)

display(to3d1(e1),to3d2(e2),to3d3(e3),transparency=0.1,axes=boxed,style=PATCHNOGRID)

 

No that doesn't work. 

Notice when axes=normal there are only 3 axes.  What I was wondering is if there is an option for axes=boxed to keep three of axes with ticks stationary as the you rotate the model.  Every the model is unclicked after rotating the axes lines shift to a new edge. 

Wait ... actually this is a better explanation for what I mean.  I was trying to achieve axes=normal with a box wire frame, that option doesn't seem to be allowed without some trickery programming.

I tried axes=normal, axes=boxed in the same command but the most recent command overrides the previous one.  I thought it might integrate into something I was trying to get. 

I've created a procedure that puts a random set of values into a cubic matrix (or array as they seem to be referred to when they exceed 2 dimensions) and displays them in a plot.

restart;
gc();

View3dMatrix:=proc(n,ri,rf)    #n is the number of elements, ri and rf are initial and final range of random numbers
  local a,i,k,e,g,h,m;
  a:=trunc(sqrt(n)+1):
  for i from 1 to a do
    b||i:=[seq(rand(ri..rf)(i),i=1..n)]:
    c||i:=Matrix(a,a,b||i):
  end do:
  for k from 1 to a do
    d||k:=seq(seq([i,a+1-j,k,c||k[j,i]],i=1..a),j=1..a)
  end do:
  e:=plots[textplot3d]([seq(d||i,i=1..a)],axes=boxed,tickmarks=[0,0,0],color=green, font=[TIMES, ROMAN, 8]):
  g:=plot3d([[x,y,0.95],[x,y,-a*0.10]],x=1..a,y=1..a,color=brown,style=surface,lightmodel=light2):
  h:=plot3d([[x,1,z],[x,a,z]],x=1..a,z=0.95..-a*0.10,color=brown,style=surface):
  m:=plot3d([[1,y,z],[a,y,z]],y=q..a,z=0.95..-a*0.10,color=brown,style=surface):
  plots[display](e,g,h,m)
end proc:

View3dMatrix(50,1,100)

 

You still need to do garbage collection to free memory. 

gc();

 

This should also help.  http://www.mapleprimes.com/forum/securehashalgorithmsha1

Perhaps you've already found this link as well. 

Thanks, sorry I should have been a little more specific. 

In the statistics package I want to use the box and whisker plot (boxplot) and plot it on a graph with 3d data.  The boxplot is only 2d so I would probably need to add extra dimensional provisions for the 3rd dimension on a 3dimensional graph.  Or can I even graph it on a 3d graph?

A google search will have brought you this result which by now I'm sure you've found http://euler.slu.edu/courseware/CryptoSubmissionSet/Cryptography.html which includes some maple worksheets on DES and AES

Or a search of the maplesoft applications will bring up this : Cryptographic Protection of Definite PC Directory Using the AES Algorithm http://www.maplesoft.com/applications/view.aspx?SID=7086 

I don't believe there is a built in package and I'm not sure if a library exists for Maple on this topic.

 

Funny how nothing seems to keep sqrt(2) in the denominator

I can't get frontend or freeze to force a root 2 into the denominator, single quotes work but only for one operation.  The only thing I could think of was to use sqrt(2) as a label `sqrt(2)` but then it doesn't format mathematically.  If you save a variable to sqrt(2) like a:=sqrt(2).  And then try 1/`a` maple still factors it around. 

I'm sure there is a way.  If someone can do it, I'd like to see how.

In the meantime just factor out the sqrt(2)/2 and use a variable in it's place to denote the 1/sqrt(2).  That's the only way I can see how to get around this miniscule issue.

Seems it would be better to use 1/4 second averaging since that's roughly the length of signal when a car passes.  That way we would only have to do it a couple of times plus the signal was already mono, we didn't need to use ToMono.

so continuing as before. 

ma:=MovingAverage(aud2,2500):
ma2:=MovingAverage(ma,2500):
ma3:=MovingAverage(ma2,2500):
Preview(ma3);

much better

 

How about applying MovingAverages from the Statistics package a number of times to smooth out the graph?

First square the original signal.

a2:=(aud)^2

Then using the statistics package try to wean out the noise and capture a rough but more smooth average.

with(Statistics):
a3:=MovingAverage(a2,30):
Preview(a3)

Continually changing the window size from 30 up to about 400.  I repeated this about 40 times and the results are below.  The first signal is squared and the resulting signal is what I ended up with.  It's only a rough start maybe someone could suggest a better route or way. 

I guess I'm confused as to how the audio data is stored.  As above I can't view the raw data.  Browse and explore on the data don't accept that format.  To determine the number of elements op just returns the value of 4.  This is why I was wondering if I need to change to a List or a Matrix, then I could use op and extract the total number of elements.  When I change it to mono is the raw data just a sequential set of single points?  Just a few points that aren't exactly clear right away when I read the help pages also it's not always clear on how to use the options in an example if they're even used in one.

As an example if I were recording cars passing by on a highway or a racetrack I want to distinguish each car at a certain time period.  That is the average maximum would be the point at which a car had passed the recorder.  Can you give an example calculation using say for example the .wav file located here http://www.autospeak.com/library.htm using the Indy Car sounds d)IRL cars passing at full throttle WAV file?  Or another WAV file if you wish. 

how about

map(x->x,[L])

I suppose we can't really convert a seq to a list without using square brackets.  It's not really critical I was just curious.  Wonder why it can't be used in convert(L,list)  

ooops yes, scanned it too quickly.  Thanks yes the maple 12 page was exactly where I saw it.

a:=Matrix([m1,m2,m3,m4]);

                                            [m1,m2,m3,m4]

a(1,9):=m9:
a;
                                             [ m1 , m2 , m3 , m4 , 0 , 0 , 0 , 0 , m9 ]


To better reference the location with some nice examples.  It is located here, linked from the page that was referenced:  http://www.maplesoft.com/support/help/AddOns/view.aspx?path=rtable_indexing with the heading indexing Arrays, Matricies, and Vectors.  

The maple help system is a little broken up and segmented, sometimes the answer is burried deep into an unknown category totally unrelated and sometimes never in a location you might think it should be.  Just one of the interesting and sometimes hairpulling quirks in Maple... "hmm now where did I see that example again?"  I've had that happen actually a number of times and not always easy to find my answer, sometimes Mapleprimes is the best and fastest way to get the answer.                                          

                                           

Your loop can be simplified using sum
So for N=1

sum( (1/k^2)+3 , k=1..30);  # or bracket it with evalf for the decimal

For the list you could use seq. 

[evalf(seq(sum( (1/k^2)+3 , k = 1..(N*20)), N = 1..30))];
 

 

First 38 39 40 41 42 43 44 Page 40 of 47