Feeds
已回答
Write a function called GenMatBorder that takes an n x m array of numbers and produces an array called OutMat, which replaces the top row, bottom row, left column, and right column of the input array with zeros. Use logic indexing.
function [outMat] = GenMatBorder( inMat ) inMat([1,end],:) = 0 inMat(:,[1,end]) = 0 outMat = inMat end
Write a function called GenMatBorder that takes an n x m array of numbers and produces an array called OutMat, which replaces the top row, bottom row, left column, and right column of the input array with zeros. Use logic indexing.
function [outMat] = GenMatBorder( inMat ) inMat([1,end],:) = 0 inMat(:,[1,end]) = 0 outMat = inMat end
6 years 前 | 3

