这与帖子有关
更改条目是字符。为了清楚起见,提出了一个新问题。
现在 :
一个=
{1x10 cell} {1x10 cell} {1x10 cell} {1x10 cell}
一个{:}=
ans = [0] [0.4000] [0] [0] [0] [0] [0] [0] [0] [0]
ans = [0] [0] [0.2000] [0] [0.2000] [0] [0.2000] [0] [0] [0]
ans = [0] [0] [0] [0] [0] [0.2000] [0] [0] [0.2000] [0.2000]
ans = [0] [0.2000] [0] [0] [0] [0] [0] [0.4000] [0] [0.2000]
上一个的答案是:
fileID = fopen('a.txt', 'at');
fprintf(fileID, '%2.8s \n', cellfun(@(x) char(x), a));
fclose(fileID);
现在怎么解决?想要打印:
0 0.4 0 0 0 0 0 0 0 0
0 0 0.2 0 0.2 0 0.2 0 0 0
.
.
谢谢