MATLAB: Can anyone tell me the wavelength of each RGB colour that Matlab use

color spectrum estimationImage Processing Toolboxrgb

I want to know the wavelength of each RGB that Matlab use to store the value 😛
Thanks in advance.

Best Answer

"my question is whether in Matlab, red, green, and blue correspond to any specific wavelength"
No. MATLAB receives digital values somehow and it works with them mathematically, but it does not attempt to validate the data on input and it does not attempt to validate that the output devices handle them any particular way.
Sensors such as CCD receive photons. Depending on the material the sensors are made out of, and any filtering material placed above, sensors for different "colors" have peak sensitivity at particular wavelengths and lower sensitivity at others (the natural state) or no sensitivity beyond certain ranges (if filtered.) Their charge is flushed, then they are exposed to light for a period, during which time they more or less integrate received energy. The exposure is terminated and a read-out of the total charge is taken. But four photons received with 25% efficiency (because the material is not optimal for the wavelength or because filters have been put in that partly block the wavelength) is the same energy as one photon received with 100% efficiency, so any one sensor cannot tell you what the original wavelength of the photons was: a bright light off of the optimal frequency registers the same as a less bright light at optimal frequency.
The work-around with sensors is similar to what the human eye does: have several sensors with overlapping wavelengths. Adapt one particular model of what light conditions are typically like, and you can then work from the multiple sensor readings to find the most probable readings under that model.
A big problem with that is that what light conditions are "typically" like varies a lot depending on the illumination (and on whether you are recording emission spectra or absorption spectra.) See in particular Color Temperature. The amount of energy reflected at a particular wavelength depends not only on the properties of the material but on the strength of the illumination at that wavelength. For non-monochrome unfiltered light the profile depends upon the temperature of the source (and a lot of artificial sources can be modeled acceptably as if they possessed this kind of temperature.) Your skin does not inherently change wavelength in sodium lights but the illumination profile changes, so the fact that the interpretation is as if you are all yellows or purples does not mean that you really are that wavelength, just that the integral of product of the available photons and the sensitivity peaks the same way under that model as if you really were that color.
It is not even as simple as there being three sensors. Historically twice as many green sensors as blue or red were used, in a pattern called the Bayer Filter; this has to do with the human eye being most sensitive to green energy. But the original design for that was CMY sensors, which is what is used in some cameras now. Other cameras use Fovean X3 sensors, others use diffraction. Then there are the techniques used for Light Field cameras...
Remember that the output RGB readings are not necessarily the same as the sensor readings even if you are working with a set of three sensors that are most sensitive to red, green, and blue. The computations to go from sensor readings to RGB have to take into account details of the sensitivities.... and of course of the illumination model being used. The cameras that can record RAW images record the actual sensor readings, which can then be post-processed under different illumination models to produce different RGB readings.
And this is just discussing the sensing side, not even the output side. You need to look at the topic of Color Calibration, and you need to look at Gamma Curves, and at how CRTs work and how the Sony Trinitron works, and how TFTs work...
It is not uncommon for cameras to be designed to output values that attempt to follow a particular model called sRGB. Just remember that a red reading of 0.6 does not mean 0.6 times the maximum at a particular wavelength, just that the software model of the sensor readings says that "the energy ratios are the same as if you had monochrome light of 0.6 maximum at a red frequency I probably didn't bother to tell you." And as for how the three monochrome-equivalent values for the R, G, B components relate to a single wavelength original... see the link at the top. (Short answer: it is not unique.)