Reputation
31,934
Next tag badge:
99/100 score
20/20 answers
Badges
1 45 107
Newest
 Enlightened
Impact
~329k people reached

Jun
27
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
No problem Simon. Everything is working very well. Except that when an problem happen, hard to know from which line it came, since I do not see the commands as they run. But I am using lots of Print in the script to help :) Thanks.
Jun
26
comment Union of two or more lists
Your output does not match what you describe. r1 = Union[list1[[-1]], #] & /@ list2; r2 = Union[list2[[-1]], #] & /@ list3; r3 = {r1, r2}
Jun
26
comment Does Mathematica have a built-in tool that allows one to operate on both sides of an equation?
In Maple, all this works out of the box as is. I always wondered why in Mathematica these things are so much harder. Here is screen shot from my Maple session now !Mathematica graphics (ofcourse, there are things that are much harder to do in Maple than in Mathematica as well)
Jun
26
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
Would you happen to know why this method does not work when using the syntax math.exe < foo.m and one must use math.exe -script foo.m ? The reason I am asking is that using the first syntax above allows one to see the commands (IN and OUT) on the screen as they are evaluated as discussed in this question which makes it easier to see where the error is. Would be hard to modify your method to make it work with the first case as well? thanks
Jun
26
comment Solving non-linear ODE analytically in mathematica
I do not know if there is any special thing to do, just type x[T0]==0, as in ClearAll[beta, c, k, x, t]; eq = x'[t] == beta*x[t] - (c - x[t])^2/(4*k); DSolve[{eq, x[T0] == 0}, x[t], t] and I get this answer: !Mathematica graphics
Jun
26
comment Solving non-linear ODE analytically in mathematica
V10.1 solves it. Did you try it on your version and not get an answer?
Jun
26
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
I've been testing it, and so far I see no issues. It also handles embedded strings and everything else like Python's r""".
Jun
26
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
Very nice! It works very well so far. I also wrote the string to Latex file, and it compiled with pdflatex with no problems. I tested it on this file SetDirectory["G:\\tmp"]; Print[Directory[]] s=r"""\documentclass[12pt,titlepage]{article} \begin{document} \title{title} \date{1/1/2015} The following in known equation $\sin^2(x)+\cos^2(x)=1$ and this is 100% correct. This was written on 1/1/2015 and this is a string "I am a string" and this is \\n which is left as is. \end{document}"""; Print[s] str = OpenWrite["foo.tex"]; WriteString[str,s]; Close[str] thanks.
Jun
19
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
@Pickett I run the .m file using Mathematica, but from command line, not from the notebook. it is an .m file. How will I write a script that look into huge .m file of Mathematica code, prarses it, looks for certain places with strings, and replace each "\" with "\\"? Also there are things like "\n" in there, which should be left alone. It is not that easy to do. I also have to do this each time I edit the .m file again. Way too complicated. Python solution is much simpler actually. I just write r""".....""" and that is it.
Jun
19
comment Solve differential equation using a integral form boundary condition
Ok, I agree Mathematica result from my method is not correct, but my question is, what did I do wrong? where in the steps I did the error was?
Jun
19
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
@Pickett, no I do not want to get into XML and all that. way to complicated. I simply want to use Mathematica and generate Latex from it without having to keep typing "\\" all time.
Jun
19
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
@Pickett, I am confused. So what should I type for my example above? In the .m file? I do not want to put "\\" in there. I still do not know what the syntax I am supposed to use.
Jun
19
comment Mathematica equivalent to Python long raw strings? handling escape characters in packages
@Pickett How to type the solution in plain text? as in .m file? I tried TextCell but not sure I am doing it correctly. Screen shot !Mathematica graphics I do not know how to do the ctrl-9 and ctrl-0 stuff in text file. I use plain text .m files. If you can show how to do it, using my example above, without using notebook interface, just using plain text input, then that will help
Jun
18
comment Plotting a 2D mapping of a 2 column ASCII
@Guesswhoitis. yes ofcourse, Flatten is no longer needed in version 2. I had it there from version 1 in which it is needed, because the way I did it before, and I forgot to remove it again for version 2. Thanks, will remove it now.
Jun
18
comment Plotting a 2D mapping of a 2 column ASCII
@Guesswhoitis. wow! thanks, I did not know this. I'll update.
Jun
18
comment Plotting a 2D mapping of a 2 column ASCII
Yes, I needed to do [[All, 2]] first, forgot about the first element is not part of data.
Jun
18
comment Plotting a 2D mapping of a 2 column ASCII
Is this what you mean? Image[Partition[pix, 5], ImageSize -> 400] where pix is the data you show. !Mathematica graphics
Jun
10
comment Mathematica keeps crashing my machine — is there a way to prevent Mma from eating up so much system resources so this doesn't happen?
see TimeConstrained and MemoryConstrained and adding $HistoryLength = 0; at the top helps also. Other than that, maybe your PC has virus if it keeps crashing like this? I recommend ESET virus protection for PC's. I've been using it for years.
Jun
10
comment How to extract notes and chords from audio?
fyi, to use Wavelet, something like : cwt = ContinuousWaveletTransform[sound, GaborWavelet[6], Padding -> 0.0, SampleRate -> 44100, WaveletScale -> Automatic]; where the SampleRate is obtained from the file. As well as the Sound (imported, using Elements). I just do not know enough about Wavelets to answer your question on sound. Here is screen shot !Mathematica graphics
Jun
9
comment How to extract notes and chords from audio?
I got the spectrum for this, But used fft. Why do you have to use WaveletTransform for this? Screen shot !Mathematica graphics