On Wed, 26 Sep 2018, Sven Schreiber wrote:
>
>> OK, sorry for the delay. I'm attaching an attempt
Minor correction: The included helper function matof (as in: matrix
variant of atof) had a little redundancy, because atof itself already
handles empty strings. Here's the update:
<hansl>
function matrix matof(strings in, int skip[0::0])
# Returns column vector with the numerical values in the string array.
# 'skip' refers to how many leading array elements should be discarded.
N = nelem(in)
matrix m = ones(N - skip,1) * $huge # initialize to nonsense
loop i = 1+skip .. N --quiet
m[i - skip] = atof(in[i])
endloop
return m
end function
</hansl>
cheers,
sven