Tag Info

New answers tagged


First step: convert the code without modifications. This is the safest (we don't want to accidentally break the algorithm): {n, d} = Dimensions[var1]; k = ... Do[ var1[[i + 1, d - j]] = var1[[i + 2, j + 2]], {i, 0, k}, {j, 0, k} ] Next step: It looks weird to me that the iteration starts from 0, as both Mathematica and MATLAB index from 1. ...


I find using Module the easiest way to keep track of things when it comes to these kinds of situations. plot[x_, s_] := Module[{b, w, c, ua, ub}, b = 10 x; w = s + b; c = x^2; ua = w - c; ub = w - c^2; Plot[{ua, ub}, {x, -5, 5}]] plot[randomVar, 5]


It comes down to the DRY principle: The DRY principle is stated as "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." The content management system Wordpress doesn't use object oriented paradigms and so for that reason it looks exactly like your code. Tens of thousands of lines of code like this. ...


Initial problem There is, in my opinion, nothing wrong with "multidependences" in the way I think you mean, but there is a more fundamental problem here (I believe). Consider these definitions: w[b_, x_] := fixed + b[x] u[w_, b_, x_] := Sqrt[w[b, x]] I presume that you expect to call u with three arguments and have it in turn call w but this does not ...


data1 = {{x1, y1}, {x2, y2}, {x3, y3}}; data2 = {error1, error2, error3}; Transpose[{data1, ErrorBar /@ data2}] Thread[{data1, ErrorBar /@ data2}] {{{x1, y1}, ErrorBar[error1]}, {{x2, y2}, ErrorBar[error2]}, {{x3, y3}, ErrorBar[error3]}}

Top 50 recent answers are included