Get Colormap Values Corresponding to Array Values
Ältere Kommentare anzeigen
Dear Matlab Community,
Currently I am trying to visualize neuroimaging data and have thus run into the following problem:
I have an array of 1990 values, which I want to plot in different colors on a continuous colorbar. So all I would require is the information on how I can get a matrix with RGB triplets corresponding to the data in my array. I have already tried the following:
c = jet(cvals)
Which yields in the following code:
Error using /
Matrix dimensions must agree.
Error in jet (line 23)
u = [(1:1:n)/n ones(1,n-1) (n:-1:1)/n]';
Any help would be greatly appreciated.
Thank you!
2 Kommentare
Yazan
am 13 Aug. 2021
What version of Matlab do you have? When run on 2021a, no errors were received.
Hannah_Mad
am 13 Aug. 2021
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Blue finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!