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.
Direct link to this answer:
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) = ;
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Opportunities for recent engineering grads.
New to MATLAB?
Choose your country to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a location from the following list:
See all countries