MATLAB everything except last element

Is there a MATLAB shorthand for

v( 1:length(v)-1 ) % everything except last element

In Python, its

v[ :-1 ]

Does MATLAB have a similar shorthand?

Answers


v(1:end-1)

Need Your Help

Routes with Dash `-` Instead of Underscore `_` in Ruby on Rails

ruby-on-rails routing rails-routing

I want my urls to use dash - instead of underscore _ as word separators. For example controller/my-action instead of controller/my_action.