openlang

数值计算

精度、数组与科学计算代码

  1. Ported a short MATLAB script to R and one result came back as a matrix

    Trying to redo a short MATLAB script in R, and I've barely touched MATLAB before. Most of it came over fine, except for a sin…

    回复 7最近活动 rmatlab
  2. na.rm = TRUE on a group that is all NA

    Per-group totals with tapply(x, g, sum, na.rm = TRUE), and one group came back as 0. Every value in that group is NA. Not a s…

    回复 5最近活动 r
  3. A loop that allocated a column at a time

    Slicing in Julia copies, which I knew and then forgot inside a loop. Take a function that walks the columns of a matrix and d…

    回复 4最近活动 julia
  4. sum(X) on a matrix with one row

    A function takes a matrix of observations, rows are observations and columns are features, and normalizes each column with X…

    回复 6最近活动 matlab
  5. Implicit expansion turned my shape bug into a matrix

    A row vector times a column vector with .* used to be an error. Since R2016b it isn't. With a = [1 2 3] and b = [1; 2; 3], a…

    回复 3最近活动 matlab
  6. Ambiguous Julia methods and f(2, 3)

    Two Julia methods, f(x::Integer, y::Number) and f(x::Number, y::Integer). Each runs a different algorithm, chosen for whichev…

    回复 4最近活动 julia
  7. f2py copies my C-ordered array on every call

    Passing a NumPy array into a Fortran subroutine through f2py. The array is created the usual way, np.zeros((n, m)), so it's C…

    回复 3最近活动 fortran