Solved
Vectorization works only for simple functions, not e.g. a Gaussian?
- October 13, 2025
- 2 replies
- 858 views
I am trying to fill a 1D array/vector with calculated scalar values. This works fine for a simple calculation; but for a more complicated calculation, it fills the vector with nested [1x1] arrays instead of scalars. I have tried to use Vectorize to fix this, but unsuccessfully.
As an example, I define an array index i = -mf::mf. A simple function f_sub_i = f0 + df*i works fine to set up a vector of frequencies f with uniform step size df. But now I try a Gaussian function S_sub_i = e^{-[(f_sub_i -f0)/sigma]^2} , and I get a vector of nested [1x1] arrays instead of scalars. How can I get a vector of scalar values calculated by the formula for S_sub_i?
I'm using MathCAD Prime 9.0.0.0


