Changing colourmap with user input - specifying number of colours

조회 수: 1 (최근 30일)
BGranato
BGranato 2019년 1월 6일
편집: Stephen23 2019년 1월 7일
I'm making an app with app designer to view spectrograms. I then want to save the spectrogram using the colour map specified by the user.
This is my current code:
imwrite( ind2rgb( im2uint8( flipud( soundData), pink(128))));
However, I want to be able to change the colour map according to the user's preference. I have tried not specifying the number of colours or making everything into a string (e.g. ['jet' (128)], 'jet(128)', 'jet'), but none of these work.
Any ideas?

채택된 답변

Stephen23
Stephen23 2019년 1월 7일
편집: Stephen23 2019년 1월 7일
str = 'pink';
fun = str2func(str);
fun(128)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by