0

```
function g = sigmoid(z)
%SIGMOID Compute sigmoid function
%J = SIGMOID(z) computes the sigmoid of z.
g = 1.0 ./ (1.0 + exp(-z));
end
```

I'm going through the Andrew Ng Coursera course. I doubt that how `exp(-z)`

is computed directly while `z`

is a matrix?

Word of advice: You are really have to think in terms of vectors and matrices instead of scalars (ok, an scalar is just a funny word to say "single number"). This will be particularly important when calculating the loss too! – Juan Antonio Gomez Moriano – 2019-01-14T21:35:58.050