Hi Ruqayya —
This is the line that is throwing the error:
where both ‘m’ and ‘c’ are (1x1000) double vectors.
Two possibilities present themselves, since I don’t know what you want:
- —> ‘u’ is intended to be a (1x1000) double vector as well, in which situation u=m.*c; (note the ‘.*’ indicating element-by-element multiplication as opposed to vector or matrix multiplication);
- —> ‘u’ is intended to be a (1x1) double scalar, in which situation u=m*c'; (note the transpose operator (') after the c, keeping m as (1x1000) double row vector and creating c to a (1000x1) double column vector.
Your call as to what you want ‘u’ to be. One of these should work in your application. Neither of them will throw the error.