-
2 Comments
Jonathan Perry
on 17 Jun 2016
I keep receiving 'Matrix dimensions must agree' when using c(c==-d)... it seems to work fine in matlab, but not on here. Any ideas?
Jan Orwat
on 18 Jun 2016
Note that "c(c==-d) = d" means that c and d must be same size or d is scalar. Moreover if d is not a scalar, then all "c==-d" must be true. This code seems to work in rare case, when one value is negative real number, and the rest are positive real numbers, but I have not tested it.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!