Christopher2222

MaplePrimes Activity


These are answers submitted by Christopher2222

Loading a maple worksheet from any directory causes Maple to set the directory it came from into currentdir().  Using currentdir() in writedata should get you to save the file where it was loaded from.

Sending a variable from terminal to Maple ... not sure, what you mean.  Someone else may better understand what you mean.

Maybe StringTools[SearchAll]  ?

chunk:=readdata("g:/test1.txt",string)  #test1 is just an example test file of the two seperate lines you gave

also is it possible you want QXp+zr6km  and not  Qxp+zr6km ? 

None-the-less, StringTools[SearchAll] I think is what you are after.

StringTools[SearchAll]("QXp+zr6km", a)
                                                          [ [ ] , [ 34 ] ]

 

 

 

 

I may have found my answer.  It seems Cross Correlation is the name I was looking for. 

In Maple 15 a CrossCorrelation command was introduced (why not earlier? i don't know).  But I was on the right track with my proc.

 

Regarding overwritting a previous file you could include a time stamp in the file title to avoid overwritting a previously written file.  Such as when a procedure is initiated to say grab data from the internet or something and store it in some file somewhere. 

Just as an example, here is something I plucked out of one of my own procedures that does something similar to what you ask.  Here I let e represent your filename followed by a string of numbers representing the current date and time or however you wish to format it, this is just an example

e:=cat("myfilename",StringTools:-FormatTime("%Y%m%d%H%M"),".txt"): 
currentdir("f:/mynewfiles"):  # sets the directory to write the file to
writedata(e,yourdata,string): #yourdata represents the variable where your data is stored

 

 

 

In a similar topic and extension to this interesting subject.  Not intending to take away from the original question at hand but yet again the latest discover magazine comes through with another cool idea, radio vorticies.

The idea to twist radio waves and create multiple subfrequencies, identified by their degree of "twistedness".  Each subchannel carries discrete data sets.  Tuning frequencies as before except for the added fingerprint of the twist.  Here is the paper  http://arxiv.org/abs/1107.2348

The challenge is to show visualize this in Maple. 

Okay just happened to figure it out after taking a break.  Using the forward slash quotes inside the quotes works nicely. 

process[launch](cat("sndrec32.exe ","/play ","\"g:Bflat3.wav\" ","/close"))

I still can't view your solution (the red x is still there) I am guessing you came to the same conclusion I did?

I can't see your graphic, it appears as a red X.

I used " /CLOSE" in the cat command in your proc in Maple and I get error message from sound recorder

Cannot open 'c:\Bflat3.wav \CLOSE'

How did you do it? 

Use allvalues() to ween out the values of a RootOf_ expression.

For me, using mainly Maple 12, I almost always use Document mode. 

Document mode, because of it's graphical nature of 2-d math mode, sometimes requires certain tricks to make it work the way you want.  Usually if a bug exists seperate from worksheet mode it is relatively minor and associated with the 2d display that worksheet mode isn't concerned with, but workarounds are possible. 

The main problem I'm experiencing now is that it doesn't complete the launch until the while value is true

st:=time[real]:
process[launch](cat("sndrec32.exe ","/play ",SoundFile)):
while time[real]()-stsystem("tskill sndrec32");

Nothing plays.  And everything happens at once as soon as 5 seconds has been reached which seems counterintuitive.  Doesn't it?  What am doing wrong?

Take this for example

st:=time[real]():
while time[real]() - st < 5 do print(5); end do;

The 5's are not displayed until after 5 seconds.  mmm okay I guess that makes sense but in my little program above I have the process[launch] before the while loop so it should get executed before it enters into the while loop but it does not.  Maple executes the complete set and waits 5 seconds then starts the launch but immediately kills the program because Maple wants to wait to display it until the loop has finished. 

Where am I going wrong in my logic?  Or how do I get Maple to loop while sndrec32 is executed?

Also How do I get Maple to determine when sndrec32.exe has finished executing (playing) the soundfile?

Does anyone know how to close sndrec32 using tskill in a loop?  It appears Maple cannot close it after initiating the play command with the launch process.

It seems windows (oh yes, I'm using XP with Maple standard GUI not that it matters much) after initiating Maple to play the wav file in sndrec32 latches onto that application waiting for it's response or an input from there. 

I added the following in the above proc so that it is supposed to close after 2 seconds but that doesn't happen

st:=time[real]()
process[launch](cat("sndrec32.exe ","/play ",SoundFile)) 
if (time[real]() - st) > 2 then ssystem("tskill sndrec32") end if:

Any ideas?

You could then use ... ssystem("tskill sndrec32") ... somewhere to close sndrec32.exe after it was finished playing

Regarding my question to translate the ~ for Maple 12, was just a simple map transformation

sound1:=map(t->sin((2*evalf(Pi)*440)*t),t);

And your 8000Hz doesn't really sound like 8000Hz, it sounds closer to 400Hz

I forgot the translation of ~ for Maple 12 ( would someone be so kind to translate ? )

Luckily I recently just had access to Maple 15 and your pathname SoundFile:="Bflat3.wav"; seems to be the problem, changing it to include the full pathname works but not automatically. 

Changing to
SoundFile:="c:/Bflat3.wav" will allow the wav file to be loaded into sndrec32 but still requires manual play button to be pressed.  Curiously does anyone know how to get it to play automatiically?

4 days have elapsed so you have probably already found the problem.

You might be lucky enough if someone has it to lend it to you.  I don't believe Maple sells out of date software and they don't back port or support older software once a new version has been released so I'm sure someone wouldn't mind selling it to you or even giving it to you, it's up to you to work it out.  Maybe Maple would sell you a copy, if it still had one but I doubt it.  It wouldn't hurt to give Maplesoft a call.  I believe I asked about buying older versions of maple a while ago (although I didn't contact maplesoft) the general census was to obtain it from someone who was willing to sell it or give it to you. 

I do not own a MAC so I'm sorry I couldn't be of more help.  The other option is to use a Windows version 8 and use it through MAC's windows emulator but then I don't even have a windows version of Maple 8 so I can't help you with that either. 

Maple 8 is fairly old but I still believe quite useful, you would be lucky enough to find it somewhere.  I recall maybe seeing something a few years ago but to find it somewhere today ... maybe a prof has a dusty copy on their shelf they're willing to part with?

Just last year I saved Mathematica 2 on floppies + instruction manuals from waste doom (never used it and now that I think of it I'll probably even get rid of it myself). 

Good Luck!

I tried the cat operator ||

seq(is(convert(p || i, string) = "p||i"), i = 1 .. 7)
                                                   false, false, false, false, false, false, false

hmm, didn't quite work however the cat command can work here where the cat operator fails

seq(is(convert(p || i, string) = cat("p", i)), i = 1 .. 7)
                                                 false, false, true, true, true, true, true

Now, I can use this in our if to test the variable against itself

[seq(`if`(is(convert(p||i,string)=cat("p",i))=false,p||i,NULL),i=1..7)]
                                                   [sin(x), 46]

So I have found one way, maybe there is a better way?  And is there a way to get the cat operator || to work in this situation?

 **edit - add**  I don't know why I didn't think the cat operator || wouldn't work, all I had to do was shift the quotes
seq(is(convert(p || i, string) = "p"||i), i = 1 .. 7)
                         false, false, true, true, true, true, true

What I was really implying here was getting the cat operator || to work inside the quotes.  The backslash escape character \ doesn't work as I thought so maybe it's not possible the way I am thinking, the other method is fine.  Unless there is a way let me know.

 

If absolutely nothing works ie 2+2; produces nothing, then it's most likely Maple's kernel isn't connected properly or it hasn't been fully installed properly.

First 27 28 29 30 31 32 33 Last Page 29 of 48