Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016 年 4 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
[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)

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 15 日
You can use
for k=n1:-1:1
  1 件のコメント
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016 年 4 月 15 日
how i do this if i want to search in the first row ?

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by