Plus as concatenate for numeric vectors?
I’ve been using Matlab for years and I’ve never seen this before, is it new? It was hard to debug this since it’s pretty subtle
size([ones(1,10) +ones(1,10)])
Apparently if you don’t put a space after the plus sign — and there is a space before it — then + concatenates instead of adding. There’s nothing in the documentation for + about concatenating numeric arrays. I don’t really have a question, this just seems really confusing as a feature.I’ve been using Matlab for years and I’ve never seen this before, is it new? It was hard to debug this since it’s pretty subtle
size([ones(1,10) +ones(1,10)])
Apparently if you don’t put a space after the plus sign — and there is a space before it — then + concatenates instead of adding. There’s nothing in the documentation for + about concatenating numeric arrays. I don’t really have a question, this just seems really confusing as a feature. I’ve been using Matlab for years and I’ve never seen this before, is it new? It was hard to debug this since it’s pretty subtle
size([ones(1,10) +ones(1,10)])
Apparently if you don’t put a space after the plus sign — and there is a space before it — then + concatenates instead of adding. There’s nothing in the documentation for + about concatenating numeric arrays. I don’t really have a question, this just seems really confusing as a feature. mathematics, arrays MATLAB Answers — New Questions









