Filter löschen
Filter löschen

How can I calculate the resistance of a color coded resistor based on its band color?

3 Ansichten (letzte 30 Tage)
I am working on a project to calculate the resistance & I need the code required for this task.

Antworten (1)

Bshara Murr
Bshara Murr am 20 Nov. 2017
First each color is assigned to a number, you can search the internet for those. Now once you have those you start replacing the first two numbers by their values, say the first two colors are yellow(4) and red(2), you write 42 the third color would be the power of 10 multiplied by the number you got. Say brown(1) is the third color you will have now 42.10^1=420 ohms. The last color will be the tolerance.
As to the code you will have to write it yourself, i have already done most of the job for you but here's a hint, you ask the user to enter the first color and you get it with switch case, and replace each color by the corresponding number, or if you are not familiar with this method you can simply use "if" and "elseif" for each entered color. Good luck

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by