Question: Wavelengths ( Conditional Statement Practice ) My Solutions The following code has been written with the intent of telling the user what color they can

Wavelengths (Conditional Statement Practice)
My Solutions
The following code has been written with the intent of telling the user what color they can expect to see based on the measured wavelength [nm] of photons passing through a wavemeter. However, the student who wrote this code did so poorly, and needs help figuring out where they went wrong.
Your job is to debug this code based on the following criteria for light:
Violet: [400,450)
Blue: [450,490)
Cyan: [490,520)
Green: [520,560)
Yellow: [560,590)
Orange: [590,635)
Red: [635,700]
Error for a color outside of the range 400,700
All dimensions are in [nm]. Pay close attention to the difference between a bracket and a parenthesis symbol.
Function 8
Save
Reset
MATLAB Documentation
\table[[1,function C= myFunction(WL)],[2,if WL 400&&WL>700
Wavelengths ( Conditional Statement Practice ) My

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!