- Request user input for the 4-band color code. (See https://www.mathworks.com/help/matlab/ref/input.html)
- identity the 4-band color code in the standard RGB
- lookup the corresponding values from the table
- determine the resistance of the resistor.
- display the result (see https://www.mathworks.com/help/matlab/ref/fprintf.html)
how i start?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/957095/image.png)
0 commentaires
Réponses (1)
Sam Chak
le 8 Avr 2022
Modifié(e) : Sam Chak
le 8 Avr 2022
@shamsa khalid
I'll give a general idea. You need to search some functions on the help documentation.
The chart is essentially a table. Perhaps you can create a table and then write a function to do the following:
2 commentaires
Sam Chak
le 8 Avr 2022
After giving some thoughts, I think RGB values and the table are not needed in your case. If the color band is Brown, Orange, Green, Gold, then you can display an image and ask the user to enter accordingly:
code = [1 3 5 G]
and hit 'Enter'. The algorithm should determine and display the resistance as:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/957245/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/957250/image.png)
Note that Band #3 Black should be 0 because
.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/957255/image.png)
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!