Skip to content

Commit 4e1fd72

Browse files
authoredJun 26, 2024
Update noteworthy-differences.md (#54939)
Additional comparison with Matlab for bulk editing matrices for operations such as applying a threshold. Useful discussion here: https://discourse.julialang.org/t/replacing-values-of-specific-entries-in-an-array-in-julia/25259 and here: https://stackoverflow.com/questions/56583807/replacing-values-of-specific-entries-in-an-array-in-julia
1 parent 14956a1 commit 4e1fd72

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎doc/src/manual/noteworthy-differences.md

+3
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ may trip up Julia users accustomed to MATLAB:
8282
provides the higher order functions [`filter`](@ref) and [`filter!`](@ref), allowing users
8383
to write `filter(z->z>3, x)` and `filter!(z->z>3, x)` as alternatives to the corresponding transliterations
8484
`x[x.>3]` and `x = x[x.>3]`. Using [`filter!`](@ref) reduces the use of temporary arrays.
85+
* Following on from the previous point, to replace values that meet specific criteria, for example a
86+
thresholding operation on all elements in a matrix, could be achieved in Matlab as follows `A(A < threshold) = 0`.
87+
The Julia equivalent would be `A[A .< threshold] .= 0`.
8588
* The analogue of extracting (or "dereferencing") all elements of a cell array, e.g. in `vertcat(A{:})`
8689
in MATLAB, is written using the splat operator in Julia, e.g. as `vcat(A...)`.
8790
* In Julia, the `adjoint` function performs conjugate transposition; in MATLAB, `adjoint` provides the

0 commit comments

Comments
 (0)