New answers tagged

2

FromLetterNumber@Range@Range[4] {{a},{a,b},{a,b,c},{a,b,c,d}}


10

mat = ConstantArray[1, {4, 4}] - IdentityMatrix[4]; LinearSolve[mat, {-1, 3, 5, 8}] {6, 2, 0, -3}


12

s = {w, x, y, z}; sum = {-1, 3, 5, 8}; add = Plus @@@ Subsets[s, {3}] (* {w + x + y, w + x + z, w + y + z, x + y + z} *) Solve[add == sum, s] (* {{w -> -3, x -> 0, y -> 2, z -> 6}} *)


7

Michael E2 is correct in that Max is remarkably capable with functions as well as values. Defining f1[x_] := -2 x + 2 f2[x_] := -x + 1.5 f3[x_] := x - 0.5 f4[x_] := 2 x - 2 funcs = {f1[x], f2[x], f3[x], f4[x]}; We can use Max to get the function of the envelope: m[x_] = PiecewiseExpand@Max[f1[x], f2[x], f3[x], f4[x]] Plot[funcs, {x, 0, 2}, Epilog ...


0

Let f[x_] := {-x+2,-2x+3,1.1x-1,2x-3} A=0; B=3; Plot[Evaluate@f[x],{x,A,B}] With this, Flatten[Ordering[#,-1]&/@f/@ Mean/@Partition[Sort@Flatten[{A,B,x/.Table[NSolve[{f[x][[i]]==f[x][[j]],A<=x<=B},x],{i,1,Length[f[0]]-1},{j,i+1,Length[f[0]]}]}],2,1]]//.{a___,b_,b_,c___}:>{a,b,c} Outputs {2,1,3,4}. This code works also for non-linear ...



Top 50 recent answers are included