how to truncate specific rows and columns of matrix in matlab.

112 次查看(过去 30 天)
A = [10,20,30,40; ...
20,30,40,50; ...
30,40,50,60; ...
40,50,60,70];
now i want to truncate the row no 2 and col no 2 and wants to get new matrix of 3x3? kindly help me

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2016-1-3
A(2,:)=[]
A(:,2)=[]
  4 个评论
hani
hani 2016-1-12
sir i have a matrix 10x10 and i want to remove row and col no 3,5,7,8,10 and wants to get 5X5 matrix there are different ways to truncate but i need that way in which original matrix should remain same and truncation process should done in a new metric, one solution of truncation..... B=A(:,2:7); C=B(2:7,:); that means we want entities from 2 to 7 remaining will truncate. but i need a specific row and col to delete........ and net matrix with new name???/?
Steven Lord
Steven Lord 2020-11-16
Rajinder singh wrote a flag that is more of a comment.
we can also delete columns by this method, but in case of columns deletion, the colon has to come first in the bracket, then comes the cols_to_delete
Please use flags for alerting contributors with higher level of privileges of spam, places where someone has edited away a question, answer, or comment that renders later answers or comments unclear, etc. If you have clarifying questions, additional information to contribute (as was the case here), or want to start / reopen a discussion please add a comment.

请先登录,再进行评论。

更多回答(1 个)

Andrei Bobrov
Andrei Bobrov 2016-1-3
out = A([1,3:end],[1,3:end])

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by