Quantcast
Channel: Matlab: replace element in matrix by the minimum of the row excluding itself - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by gnovice for Matlab: replace element in matrix by the minimum of the...

You can use a new function movmin introduced in MATLAB R2016a to solve this with a moving minimum:In = [1 2 3; 4 5 6; 7 8 9]; % Sample dataC = size(In, 2); % Get the number of columnsout = movmin(In(:,...

View Article



Answer by user2999345 for Matlab: replace element in matrix by the minimum of...

I did it with two calls to min. you can do similarly with sort(In,2):% input matrixIn = [1 2 3; 4 5 6; 7 8 9];% compute minimum for each row[val,mincols] = min(In,[],2);% generate matrix made of...

View Article

Matlab: replace element in matrix by the minimum of the row excluding itself

I want to replace each element by the minimum of its row, other than the element itself.Example: input In = [1 2 3; 4 5 6; 7 8 9], output out = [2 1 1; 5 4 4; 8 7 7]EDIT: without for loop, unless...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>