I have a matrix A in Matlab of size ax2 and a vector class of size ax1. The vector class contains integers from 1 to 237. class(i) tells the class A(i,:) belongs to. For example
clear
rng default
a=10000;
A=randn(a,2);
class=randi(237,a,1);
I would like to do a scatter plot of A(:,1) on A(:,2) assigning the same colour to points in the same class. However, how can I generate 237 colors? I would be fine with having 237 nuances of blue for example, but I don't know if this is even possible in Matlab.
classis a MATLAB function. If you use it as a variable, you are hiding the real function, and that may cause serious errors later. I suggest renamingclasstoclass_dataor some other non-MATLAB name. - Ander Biguri