output will not suppress even with a semi colon

21 views (last 30 days)
Hello I am having an issue with a code. I have a semi colon everywhere in my code yet it still outputs the answer when I don't want it to. I have the code below. It will always outputs j and I have no idea how to make it stop. Any help would be appreciated! Thank you in advance.
[ j, out, Matches ] = Make_Numbers(Test_Sum, DATA, Thold, Bonusflag, n)
out = DATA;
[a,b] = size(DATA);
out = [out cellstr(num2str((1:a)'))];
start = 1;
stop = a;
e = 1;
for i = 1:e;
Test_Sum = max(Test_Sum, Test_Sum');
[~,Matches] = find_matches(Test_Sum,Thold);
sub_Graph = find_subgraph(Matches);
disp(num2str(length(sub_Graph)));
%Strength Function
if(Bonusflag)
STR = strength(sub_Graph, Test_Sum);
[sub_Graph,peoplenum] = refineID(STR,DATA(start:stop,35), AAA,
sub_Graph);
disp([num2str(peoplenum) ' members']);
end
[c,~] = size(Test_Sum);
temp = cell(c,1);
[~,d] = size(sub_Graph);
check = true(d,1);
for j = 1:d;
target = sub_Graph{1,j};
[~,h] = size(target);
for k = 1:h;
temp{target(1,k), 1} = ([num2str(n,'%02d') '-' num2str(j,'%04d')]);
check(target(1,k),1) = false(1,1);
end
end
if(sum(check))
error('NOT ALL PERSONS USED');
end
out(start:stop, b+1) = temp;
end
end

Accepted Answer

Roger Stafford
Roger Stafford on 28 May 2013
Edited: Roger Stafford on 28 May 2013
Semicolons will not suppress the actions of the 'disp' function. You need to remove them if you don't want to see an output from them.
Also I notice you don't have a semicolon after the first line and the "function" designation is not there. That will produce an output as it stands.
  1 Comment
Ryan
Ryan on 28 May 2013
Wow, thank you so much. I just commented out the disp and it worked. Thank you.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!