I suspect the problem is with:
soleus(stim_Hz)
Here, ‘stim_Hz’ must be either logical, or integers greater than 0. There are a number of ways to convert non-integer numbers to integers (for example ceil, others are linked to in that page), and comparisons to a value will prodice a logical vector.
.