Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

how to change this code for search from last column to search from first column?

1 visualizzazione (ultimi 30 giorni)
[n1,m1]=size(Complete_Fill);
for k=1:n1
id_before=strfind(Complete_Fill(k,:),[0 1]);
id_after=strfind(Complete_Fill(k,:),[1 0])+1;
Complete_Fill(k,[id_before id_after])= -1;
end
X = randi([0 1], n1,m1);
index = (Complete_Fill(:) ~= 0);
X(index) = Complete_Fill(index)

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 15 Apr 2016
You can use
for k=n1:-1:1

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by