Why can I add a empty array to a scalar variable, but I cannot add an empty array to a vector?
Show older comments
In MATLAB it is possible to add an empty array to a scalar variable, namely,
>> 5 + []
and this results in an empty array. However, adding an empty array to a vector results in a dimension mismatch, namely,
>> [2 3] + []
namely,
Error using +
Arrays have incompatible sizes for this operation.
Why can I add a empty array to a scalar variable, but I cannot add an empty array to a vector?
Accepted Answer
More Answers (0)
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!