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

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 30 Dez. 2014
Bearbeitet: Sean de Wolski am 30 Dez. 2014

0 Stimmen

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 Kommentar

per isakson
per isakson am 30 Dez. 2014
... but it will let coding mistakes pass unnoticed.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by