Is this behavior documented (for R2013a)
>> ix = 1:[4:12]
ix =
1 2 3 4
The Code Analalyzer issues a warning but Matlab evaluates the code without warning or error. I think a warning is appropriate.
&nbsp

 Réponse acceptée

Sean de Wolski
Sean de Wolski le 30 Déc 2014
Modifié(e) : Sean de Wolski le 30 Déc 2014

0 votes

Documented:
web(fullfile(docroot, 'matlab/ref/colon.html'))
If you specify nonscalar arrays, MATLAB interprets j:i:k as j(1):i(1):k(1)

1 commentaire

per isakson
per isakson le 30 Déc 2014
... but it will let coding mistakes pass unnoticed.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by