matlab:在excel中rgb的颜色是错误的

我只添加了我的代码的相关行:

asume我有RGB [106 113 50]。 我想通过它的颜色给单元格A1着色到A7。

在Excel中,我得到了不同于mspaint的颜色(有些网站给我带来了mspaint的相同颜色)

在这里输入图像说明

这是我的代码:

rgb = [106 113 50]; clr = rgb * [1 256 256^2]'; %# convert to long number Excel understands e = actxserver ('Excel.Application'); %# open Activex server filename = fullfile(path_of_file,name_of_file); %# full path required ewb = e.Workbooks.Open(filename); %# open the file esh = ewb.ActiveSheet; esh.Range('A1:A7').Interior.Color = clr; 

我不能从图片看到它是哪个版本的Excel。 如果它低于2007年,那么Excel只支持56种颜色的东西,所以映射到最近的一个。不pipe你的代码是什么