24,231 reputation
13481
bio website
location
age
visits member for 2 years, 11 months
seen Dec 14 at 23:49

Feb
7
comment How does the speed of WriteString compare to other languages?
@Ajasja added version using AbsoluteTiming
Feb
7
comment How does the speed of WriteString compare to other languages?
Can you please post plain code and not an image.
Feb
6
comment Mathematica can't find constants for this differential equation
@John I do not think any one can answer why DSolve could not solve this without looking at the source code for DSolve. And since I do not work at WRI, I have no access to the source code to answer this. We all could only try to speculate and give workarounds and suggestions.
Feb
5
comment trouble with Dynamic range in SetterBar
@PeeterJoot You say I actually want range to be non-constant. Ok, but in the code you posted, range was not used anywhere else other than in setting the controls. So that is why I assumed it constant. Ofcourse using range as global will always work, but if you making a demo, you can't have a global cell in the demonstration notebook and everything has to be inside the Manipulate. Even in the Initialization section, it will not work due to order of evaluation. May be it is a bug then for this control. If your setting allows using global variables, then may be this a solution you can use.
Feb
3
comment Extracting frequencies with Fouriertransformation
@holistic if you mean the py/nSamples then this is something commonly done, to average the power. Its been a while since I did dsp, so I do not remember the details now. But the above is a common way to do it (scale the psd by number of samples).
Feb
3
comment Extracting frequencies with Fouriertransformation
@holistic Please try the new code. It is was something I did before and forgot to refresh the session. Needed to zero out the DC frequency. For some reason, it was an outliner, hence it messed up the scale. I updated the code above.
Feb
3
comment Extracting frequencies with Fouriertransformation
@holistic give me few minutes to look at it again
Feb
3
comment Extracting frequencies with Fouriertransformation
@holistic You need to do SetDirectory[NotebookDirectory[]]; data = Import["testdata.txt", "List"]; as shown. This reads the data. Make sure your file testdata.txt is in the same folder where the notebook is saved to. Screen shot !Mathematica graphics and !Mathematica graphics it works for me. May be you changed your data or something.
Feb
3
comment Extracting frequencies with Fouriertransformation
@holistic I used Fourier ofcourse, I just forgot to paste the command since it was in separate cell. Updated now, thanks
Feb
3
comment Extracting frequencies with Fouriertransformation
@Öskå opps, yes sorry
Feb
3
comment Extracting frequencies with Fouriertransformation
@Öskå I do not know if it very commonly used t, but I use this method all the time. In Matlab some use this method. localhost/my_notes/mma_matlab_control/KERNEL/…
Feb
3
comment Extracting frequencies with Fouriertransformation
If you say so. I do not know about fMRI. But one sample each 2.8 seconds sounds too slow to me. any way, you can change that later if you find otherwise. change fs below, which is the sample rate of the data.
Feb
3
comment Extracting frequencies with Fouriertransformation
btw, this looks like a very low sample rate. You can adjust the code below if you think it is different. 0.357 samples per second is very low but you can check it on your end. If you meant it was 2800 samples per second, then change fs below to 2800.
Feb
3
comment Extracting frequencies with Fouriertransformation
Ok, so fs=0.357 hz? (1/2.8)
Feb
3
comment Extracting frequencies with Fouriertransformation
What was the sampling frequency?
Jan
30
comment Animation of tube with fixed height
Ah, so that is why I could not make it work with PlotRange, I was using CapForm["Square"] as posted. So, with CapForm["Square"] there is no solution? Is this then a bug? or a feature?
Jan
30
comment Cannot calculate an integral
One way to find where the problem is, is to keep throwing away terms until you find where it is stuck. one problem is this Integrate[E^x E^ArcSinh[-c + x], x] can't do it in closed form. But Integrate[E^ArcSinh[-c + x], x] can. So that is where to start working at. Then start adding back stuff that was thrown out, until it gets stuck again.
Jan
29
comment Background in ItemStyle
Grid[{{1, 2}, {3, 4}}, ItemStyle -> {None, None, {{1, 1} -> Directive[30]}}, Background -> {None,None, {{1, 1} -> Red}}, Frame -> All] is OK. No error.
Jan
29
comment Background in ItemStyle
Screen shot. Need to do it with a fresh Mathematica session (restart M itself) !Mathematica graphics Next time, evaluated, the error goes away. Only first time it shows up.
Jan
29
comment Background in ItemStyle
fyi, your code gives syntax error on V9.01 on windows. An improperly formatted directive with head Symbol was encountered