changing specific rows of a logical matrix

2 ビュー (過去 30 日間)
Matthew
Matthew 2015 年 10 月 2 日
回答済み: Matt J 2015 年 10 月 2 日
I have a vSlice=MxN logical matrix. I want to be able to review the first row, last row, first col and last col for "1's" and convert them to "0's". I believe the lines below will pull out the relevant data. I am looking to change the rows without making any new variable. Thank you.
%test border rows columns
endcol=vSlice(:,end);
endrow=vSlice(end,:);
col1=vSlice(:,1);
row1=vSlice(1,:);

採用された回答

Matt J
Matt J 2015 年 10 月 2 日
vSlice([1,end],[1,end])=0;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by