how to count the number of outputs obtained in command window

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 commentaires

TAB
TAB le 10 Sep 2012
Modifié(e) : TAB le 10 Sep 2012
'if' is conditional statement, not a loop !
I suggest to post th code. Otherwise we can only guess what you are talking about.
But when I read the question word by word, the answer seem to be easy: The number of generated outputs is 7.
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
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

Connectez-vous pour commenter.

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 10 Sep 2012
Modifié(e) : Azzi Abdelmalek le 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

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Produits

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by