How do I get multiline console output in MATLAB? Using horzcat gives me an error
fprintf(['# True Positive: %d \n',...
            '# False Positive: %d \n',...
            '# True Negative: %d \n',...
            '# False Negative: %d \n,',...
            numTruePos,...
            numFalsePos,...
            numTrueNeg,...
            numFalseNeg]);
but then I get the error:
??? Error using ==> horzcat
The following error occurred converting from logical to
char:
Error using ==> char
Conversion to char from logical is not possible.
Error in ==> toyPro开发者_运维技巧blem at 40
fprintf(['# True Positive: %d \n',...
You appear to have the closing bracket ] for the format string in the wrong place. Try this:
fprintf(['# True Positive: %d \n',...
         '# False Positive: %d \n',...
         '# True Negative: %d \n',...
         '# False Negative: %d \n'],...  %# Moved it to here...
         numTruePos,...
         numFalsePos,...
         numTrueNeg,...
         numFalseNeg);  %# ... from here
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论