Filter löschen
Filter löschen

how to count the number of outputs obtained in command window

1 Ansicht (letzte 30 Tage)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran am 10 Sep. 2012
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 Kommentare
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran am 10 Sep. 2012
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 am 10 Sep. 2012
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

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 10 Sep. 2012
Bearbeitet: Azzi Abdelmalek am 10 Sep. 2012
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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by