confused
confused

Reputation: 49

MATLAB relu "Incorrect number or types of inputs or outputs for function relu"

I'm trying to use the relu function on a matrix in MATLAB, and am calling it as A = relu(A), but I keep getting the error

Incorrect number or types of inputs or outputs for function relu.

I tried it on a scalar as well, and also get the same error. What could be causing this?

Upvotes: 1

Views: 536

Answers (1)

Edric
Edric

Reputation: 25160

In MATLAB, relu is a method of dlarray. So you need to pass in a dlarray instance as input, like this:

out = relu(dlarray(1)) % or whatever value you wish

Upvotes: 2

Related Questions