Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 uint32 类的 512*512 矩阵的内容读取到文本文件中。该矩阵的内容为 0 和 1。以下代码不断向我返回此错误:“来自非单元格数组对象的单元格内容引用。”
fileID = fopen('my_data.txt','w'); [nrows,ncols] = size(matri_working_now); for row = 1: nrows fprintf(fileID,matri_working_now{row,:}); end
有什么建议/想法吗?
谢谢!!
尝试更换
fprintf(fileID,matri_working_now{row,:});
和
fprintf(fileID,matri_working_now(row,:));
看起来您正在尝试matri_working_now使用花括号作为单元格访问{},而您应该使用括号将其作为常规矩阵访问()。
matri_working_now
{}
()