필터 지우기
필터 지우기

how to count the number of outputs obtained in command window

조회 수: 1 (최근 30일)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 9월 10일
When i perform a 'if' loop operation, 7 outputs are generated.. the outputs are 2,5,34.. etc., how to find the number of outputs generated.
  댓글 수: 4
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012년 9월 10일
t=xlsread('table.xlsx');
w=t(:,2:5);
v=w(:,2:4);
for i=1:14
numerator = ismember(v,v(i,:),'rows');
if (sum(numerator)==1)
t(:,6)=0;
i
end
end
Walter Roberson
Walter Roberson 2012년 9월 10일
Sivakumaran, please add meaningful tags to this question to make it easier to categorize. See http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

댓글을 달려면 로그인하십시오.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 9월 10일
편집: Azzi Abdelmalek 2012년 9월 10일
t=xlsread('table.xlsx');
w=t(:,2:5);
v=w(:,2:4);
Output_Number=0
for i=1:14
numerator = ismember(v,v(i,:),'rows');
if (sum(numerator)==1)
t(:,6)=0;
Output_Number=Output_Number+1
end
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by