Problem 2661. Change Vector Value
59.46% Correct | 40.54% Incorrect
Last Solution submitted on Mar 15, 2023
James on 6 Nov 2014
Interesting. [d==1] has a Cody size one greater than (d==1). Any thoughts as to why?
J.R.! Menzinger on 7 Nov 2014
The brackets are the operation "conatenate elements" so it is interpreted as an extra operation. The expression [1:10] has the same meaning (result) as (1:10) but in the first case you have done an extra operation (not necessary in this case). On the same way you can use [1 5] but if you use (1 5) you become an error because there is no concatenation with simple parenthesis.
James on 7 Nov 2014
Nice. Thanks for the explanation, J.R.
Problem Recent Solvers89
Find the sum of the elements in the "second" diagonal
construct matrix with identical rows
More from this Author21
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!