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

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by