开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜