我有一个奇怪的问题......我无法创造传奇:假设我有:
fraction1Str = strcat('F1 = ', sprintf('%g',round(fraction1*100)/100), '+/-',sprintf('%g',round(fraction1STD*100)/100));
fraction2Str = strcat('F2 = ', sprintf('%g',round(fraction2*100)/100), '+/-',sprintf('%g',round(fraction2STD*100)/100));
fraction3Str = strcat('F3 = ', sprintf('%g',round(fraction3*100)/100), '+/-',sprintf('%g',round(fraction3STD*100)/100));
fractionStr = [fraction1Str; fraction2Str; fraction3Str];
...
hleg = legend(fractionStr);
这给了我错误:CAT 参数尺寸不一致。
所有字符串都是相同的格式,偶数个字符......有趣的是,如果我改为其中之一
fractionStr = [fraction3Str; fraction3Str; fraction3Str];
fractionStr = [fraction2Str; fraction2Str; fraction2Str];
fractionStr = [fraction1Str; fraction1Str; fraction1Str];
它的工作,但没有这三个不同的字符串......有什么想法吗?