how to solve scatterplot error in matlab

谁说胖子不能爱 提交于 2019-12-02 13:21:59

You are feeding scatter with 4 arguments: scatter(X, Y, S, C). Your error states:

C must be a single color, a vector the same length as X, or an M-by-3 matrix.

meaning that the fourth argument g1 does not have the same dimensions as the first argument.

What probably happened here is that you didn't re-initialize g1 before the loop, and so it retained its previous size. Put the following line before the for-loop:

g1 = zeros(size(k31));

and it should work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!