MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何在MATLAB中获得多行控制台输出?使用horzcat给我一个错误 (https://www.labfans.com/bbs/showthread.php?t=26157)

poster 2019-12-14 20:13

如何在MATLAB中获得多行控制台输出?使用horzcat给我一个错误
 
fprintf(['# True Positive: %d \n',... '# False Positive: %d \n',... '# True Negative: %d \n',... '# False Negative: %d \n,',... numTruePos,... numFalsePos,... numTrueNeg,... numFalseNeg]); 但是我得到了错误:

??? 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 ==> toyProblem at 40 fprintf(['# True Positive: %d \n',...

[B]回答:[/B]

您似乎在错误的位置使用了格式字符串的右括号[ ] 。尝试这个:

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

[url=https://stackoverflow.com/questions/4654682]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:35

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.