molekyla777
• Member for 8 years
• Last seen this week

Try this Transpose@{list1[[All,1]],list1[[All,2]],list2} or this MapThread[{#1[[1]], #1[[2]], #2} &, {list1, list2}]

Edit: This work for me. V1=ph1=beta=V2=w2=ph2=alpha2=alpha1=w1=1; F[t_]:=V1 (Cos[w1 t-ph1] Exp[-alpha1 t]-Cos[ph1] Exp[-beta t])+V2 (Sin[w2 t+ph2] Exp[-alpha2 t]-Sin[ph2] Exp[-beta t]); data=Table[{t,...

Try this: Y={1,3,4,1,2,3,5,5,2}; X=Y-1; data=Transpose[{X,Y}]; Select[data,#[[2]]==Max[Y]&][[All, 1]] or shorter Pick[X, Y, Max[Y]]

Check if CUDALink is supported on your system. Needs["CUDALink`"] CUDAQ[] If return True use CUDAFourier and CUDAInverseFourier function.

Try this. This approach correct if Length[xAxisdData]==Length[yAxesdData[[i]]] xAxisdData={1,2,3,4}; yAxesdData={{1,2,3,4},{1,4,9,16}}; dataToPlot=Transpose[{xAxisdData,#}]&/@yAxesdData; ...

Edit Try this Eliminate[ToExpression[ToString[{"x1"+"x3"-"x4"==0,"x1"+"x2"+"x3"==0}]],{x1}]

Here is elegant way. Not fast but pretty func[lst1_List, lst2_List] := Module[{f1, f2, x}, SetAttributes[f1, Orderless]; SetAttributes[f2, Orderless]; f1[x__] := x; f2[x__] := x; TrueQ[{f1 @...

I think you have deal with Mathematica application. I know 2 way for solv this problem 1) Add path to your application in variable $Path. And then load with Get AppendTo[$Path,"C:\\path\\to\\your\\...

First of all avoid using For loop better (and faster) use Do instead. stream = OpenWrite["c:\\1.txt"]; Do[ z = Exp[x^2]; Write[stream, z] , {x, 0, 100000, 0.5}]; Close[stream]; PS: it is best ...

All function you need it's DistributeDefinitions and ParallelTry f1 := RandomInteger[{1, 24}] + RandomInteger[{1, 24}]; func[x_] := While[True, If[f1 === 2, Print["snake eyes"]; Return[...

There is undocumented function which return working (temporary) and target CCompilerDirectories[] (*{C:\Users\Александр\AppData\Roaming\Mathematica\SystemFiles\LibraryResources\Windows-x86-64,C:\...

I don't know why, but replacing Switch with nested If solved the problem of leaking memory.

Small advice: use Missing[] instead of whitespace character. And dataset look better PS: if you have deal with time series probably better use TemporalData or TimeSeries

Use Replace with levelspec = 1 createArray[array_, n_] := Composition[ Flatten[#, 1] &, Replace[#, x_ :> ConstantArray[x, n], 1] & ][array] Check function: createArray[{{a},{b},...

Let's denote values {t, f(t)} as F, then interpolate this array with ListInterpolation. fx = ListInterpolation[F[[All, 2]], {F[[1, 1]], F[[-1, 1]]}] Now we may use Integrate with fx Integrate[Sin[...

Use data[[All,1]] for all x coordinates and data[[All,2]] for all y coordinates

Documentation say: Import["!prog","format"] imports data from a pipe. I suggest that ParallelMap sent many requests to external program in one time and it return errors, but Mathematica interpret ...

You function is f = x^2 + y^2 - (2 x^2 + 2 y^2 - x)^2; Then call function Maximize Maximize[f, {x, y}] (*{27/64,{x->3/4,y->0}}*) And here is plot of you function

1) K is a built-in symbol. Don't use this symbol. 2) Use DistributedContexts with ParallelTable tab = ParallelTable[1/299792^2*d*(K[10^5, 10^9, RcG[d, t]] - K[10^5, 10^9, 7.6] - d*T) + f[d, RcG[d, ...

Try this langlength = ({#, Length@DictionaryLookup[{#, All}]} & /@ DictionaryLookup[All]); lst = Sort[langlength, #1[[2]] > #2[[2]] &]; TableForm[lst, TableHeadings -> {Range[Length[lst]...

Allways you can use pattern replace expr1 = a^2 - b + c*d expr2 = a - b expr3 = -a + b - c expr/. Times[-1, x_] :> Times[1, x] (* a^2 + b + c * d a + b a + b + c *)

Here is one way. MyFunc[l_] := Block[{t1, t2, res}, t1 = Tally[l[[All, 1]]]; t2 = Tally[l[[All, 2]]]; res = {t1[[All, 2]], t2[[All, 2]], t1[[All, 1]], t2[[All, 1]]}; Return[res]; ];

Maybe this will be helpful: Module[{n=300,p=0.29,r1,r2,r3,r4,x,y}, r1=y>(1/2)*(n-x); r2=y+x<=n; r3=y>p/(1-p)*x; (*RegionPlot[#,{x,0,n},{y,0,n},PlotStyle\[Rule]Opacity[.3]]&/@{r1,r2,r3}*) ...

In MMA10 this can be done with TimeSeriesWindow EDIT Here base version of TimeSeriesWindow for MMA9 SelectBetweenDates[financialData_,{startDate_,endDate_}]:=Select[financialData,AbsoluteTime[...

This may help: locations=RandomInteger[{-10,10},{4,2}]; holes=RandomInteger[{-10,10},{4,2}]; ListPlot[{locations, holes}, PlotLegends -> {"locations", "holes"}] distanceFunc = Nearest[holes, ...

For plotting circles more natural use polar coordinate system: P1 = {Sqrt[2]/2, Sqrt[2]/2}; P2 = {-1, 0}; theta1 = ArcTan @@ P1; theta2 = ArcTan @@ P2; PolarPlot[1, {r, theta2, theta1}, PlotRange -&...

Not pretty, but work #@Select[data,MemberQ[#,Alternatives@@{1,2}]&][[All,6]]&/@{Max,Min}

or more general: youFunction[intervals__] := Composition[ DeleteCases[#, Interval[]] &, DeleteDuplicates, (IntervalIntersection @@ # &) /@ # &, Subsets[#, {2}] &, ...