[coeffA,scoreA,latentA] = pca(X);
13 次查看(过去 30 天)
显示 更早的评论
The editor is complaining that the matrix of values, scoreA, is unused.
0 个评论
采纳的回答
Steven Lord
2025-9-16,13:41
If you truly do not need the second output (but do need the first and third) tell MATLAB to ignore the second output when you call pca.
0 个评论
更多回答(1 个)
John D'Errico
2025-9-18,13:14
编辑:John D'Errico
2025-9-18,13:24
The editor likes to complain. Just the kind of program it is.
Think about this as a suggestion, a hint, in case maybe your code has an error in it. This might help you to locate the bug, IF there is one. If not, then feel free to ignore the complaint. A complaint like this is not an error message, just a complaint from that whiny, pesky editor.
If it still bothers you for whatever reason, then do this:
[coeffA,~,latentA] = pca(X);
That tells MATLAB to not store the second return argument from PCA. That second argument now goes directly into bit bucket limbo, never to be seen again. But now the complaint will go away, and the editor will be happy again, free to find something else it dislikes about your code. What can I say? You will never make it truly happy.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!