MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Opportunities for recent engineering grads.
New to MATLAB?
e.g i have matrix a :
i want to cut the last 2 row of matrix A ? and become
No products are associated with this question.
a = (1:7)'; n = 2;
A = a(1:end - n);
a(end - [n-1, 0]) = ;
Direct link to this comment:
The 2nd command might be:
a(end - (n-1:0)) = ;
But this would be faster (for large problems), because the vector end-n-1:end is not created explicitly:
a(end-n-1:end) = ;
Direct link to this answer: