Tag Info

Hot answers tagged

16

I think SmoothDensityHistogram (docs here) is what you are looking for: data1 = RandomVariate[BinormalDistribution[{0, 0}, {2, 3}, 0.5], 100000]; data2 = RandomVariate[BinormalDistribution[{3, 4}, {2, 2}, .1], 100000]; data = data1~Join~data2; This is just some random sample data. If you plot it using ListPlot, you obtain the "blob" you mentioned: ...


10

It looks like kjo did something very similar. data1 = RandomVariate[BinormalDistribution[{0, 0}, {2, 3}, 0.5], 100000]; data2 = RandomVariate[BinormalDistribution[{3, 4}, {2, 2}, 0.1], 100000]; data = data1~Join~data2; Module[{vals, vc, f}, f = PDF[SmoothKernelDistribution[data, PerformanceGoal -> "Speed"]]; vals = Rescale[ParallelMap[f, data]]; vc = ...


9

OK, I figured out a solution, based on Jim Baldwin's suggestion (and borrowing a trick from Lebesgue ;-) ). The basic idea is this: use SmoothKernelDistribution to get a density function for the data; use this function to classify the original data points into level sets according to their probability density; the final plot is a composite of the plots of ...


5

Rather than modelling the non-linearity analytically, I've directly attempted to remove it. The longer trend features of the spectrum have been extracted by smoothing out most of the noise and signal, then subtracting these from the original spectrum. A convenient way to do this is with an interpolation function, Interpolation, constructed from the ...


3

In the interest of providing yet-another-method™, here's the crazy Image/Colour processing approach that first popped into my head after reading @chuy's answer (mainly because Opacity directives are pretty slow on my machine). Not so much a complete answer to the problem, as I haven't worked out frames and other luxuries, but an alternative route that ...


3

Credit goes to Ondřej Grover from the Signal Processing stackexchange. He suggested using a High pass filter, as it clearly seems to be some low frequency signal. His solution involved a Python script (found here) but something similar can be done with Mathematica. Using a forward-backward method and some experimentation with cutoff values, we can use ...


2

Let's compare two flavors based on Pick (slightly modified version from Pickett) and Select. I will assume that data is in {timestamp, value} format and glitches data is just timestamp. Both functions return filtered dataset that has no glitches datapoints. I will start a fresh kernel. glitchtimelist = {2, 3}; datatimelist = {{1, 2.31231}, {2, 2.11241}, {3, ...


2

There are a few formatting issues to take care of before you can use the data imported from Excel. Let's start with a simple adjacency matrix: WeightedAdjacencyGraph[ {{∞, 1, ∞}, {∞, ∞, 1}, {1, 1, ∞}} ] which generates the following graph: Let's export that adjacency matrix to an Excel file: Export["adjmat.xlsx", {{∞, 1, ∞}, {∞, ∞, 1}, {1, 1, ∞}}] ...


2

Assuming, from the syntax, that you are on a Windows PC. I can't remember where I saw this, but i had similar issue with my Arduino and resolved it by referring to the port in the following manner: dev = DeviceOpen["Serial", "\\.\\COM11"]; DeviceWrite[dev, 1]; (* Code to read the data stream... *) DeviceClose[dev]; Please note the whacky ...


1

Median itself doesn't work on associations of vectors: In[9]:= Median[{<|"a" -> 1, "b" -> 2|>, <|"a" -> 3, "b" -> 4|>}] During evaluation of In[9]:= Median::rectn: Rectangular array of real numbers is expected at position 1 in Median[{<|a->1,b->2|>,<|a->3,b->4|>}]. >> Out[9]= Median[{<|"a" -> 1, ...


1

Here is a way to do what you want in one go. If you put your file names in a list named e.g. files, then the following gives you a list of lists, where each sub-list gives you the "T" value paired with the average of the corresponding "tts" value: getData[files_?(VectorQ[#, StringQ] &)] := Module[{str = ReadList[#, String] & /@ files // Flatten}, ...


1

Here's how I'd do it... Grab all the file names you want from a directory: files = FileNames["*.txt", "directory_here"]; Then apply a function to grab those values... grabdata[filepath_] := Module[{text = Import[filepath, "Table"]}, Thread[Cases[text, {#, num_} :> ToExpression[num]] & /@ {"T=", "tts="}]] grabdata/@files {{1, ...


1

As suggested by @guess I would use Import[..., "Table"] to read in the data as a mixture of strings and numeric values, then use a rule to convert the complex values (with not a For loop in sight!). This method does not require you to know the complex column positions in advance. Firstly I copied and pasted your example data to create a string: stringData ...



Only top voted, non community-wiki answers of a minimum length are eligible