Output error in the grayscale

Hi have this code:
resRGB = HSVtoRGB(resHSV);
but i have this error:
Input error: please pass as input a vector variable with 3 elements with value in the range [0,1]
How do I have improve my code?

回答(1 个)

yes,may be check the resHSV value,such as
resHSV = rand(10, 3)
resHSV = 10×3
0.7587 0.7579 0.0652 0.4818 0.0649 0.8844 0.0645 0.1354 0.6241 0.3727 0.3020 0.4130 0.3200 0.7897 0.9591 0.1881 0.8734 0.0345 0.5663 0.9280 0.7975 0.1788 0.2104 0.1991 0.9820 0.2493 0.1922 0.7460 0.6177 0.9019
size(resHSV)
ans = 1×2
10 3
rgb = hsv2rgb(hsv);
surf(peaks);
colormap(rgb);
colorbar

类别

在 帮助中心 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息

提问:

2022-2-25

回答:

2022-2-26

Community Treasure Hunt

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

Start Hunting!

Translated by