Get Colormap Values Corresponding to Array Values
Show older comments
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 Comments
Yazan
on 13 Aug 2021
What version of Matlab do you have? When run on 2021a, no errors were received.
Hannah_Mad
on 13 Aug 2021
Accepted Answer
More Answers (0)
Categories
Find more on Blue in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!