Hi all,
I have the following two functions and I want to sensibly merge them into
one. How to marge headers and body of function for Matrix and Vector?
-
f_scaleRestore(a::Float64, b::Float64, c::Float64) = a * b + c;
-
- # version 1
- function scaleRestore(Z::Matrix{Float64}, shift::Vector{Float64},
stretch::Vector{Float64})
- broadcast(f_scaleRestore, Z, stretch', shift')
- end
-
- # version 2
- function scaleRestore(Z::Vector{Float64}, shift::Float64, stretch::Float64
)
- broadcast(f_scaleRestore, Z, stretch, shift)
- end
Thanks in advance,
Martin