登录论坛

查看完整版本 : 在MATLAB中实现排序行


poster
2019-12-10, 20:41
我的问题与先前解决的问题有关,该问题如何在MATLAB中将数据保存到.txt文件中 (https://stackoverflow.com/questions/2925623/how-to-save-data-in-txt-file-in-matlab) 。

我的问题是,我决定sortrows输出进行排序,但是,当我删除sortrows ,会出现此错误--- 'Input files have different number of rows' ,当我离开sortrows 'Input files have different number of rows'也没有错误

我很好奇为什么...与sortrows ?

编辑:除了将B更改为B=A{:}外,我保留了其余代码。



回答:

尽管我没有在另A文章中运行代码,但看起来A是一个单元格数组,而C是一个矩阵。因此,如果要摆脱sortrows ,请尝试将其替换为B=cell2mat(A); 。



更多&回答... (https://stackoverflow.com/questions/2936035)