I have no good idea why yours does not work for me, however.
I do know that changing the loop to this seems to help:
Code: Select all
for ((i=0; i<len; i++))
do
y="${yArr[$i]}"
yy=$(echo "scale=6; $amplitude*${y%%%}*.01*2+$row")
yy=$(echo "${yy}" | bc)
# yy=`echo "scale=6; $amplitude*${yArr[$i]}*2/$qrange+$row" | bc`
coordArr[$i]="${xArr[$i]},$yy"
done