Here is a a part of my script. Actually I am making a program that calculates the value in ohms from a resistor, so the user just have to type the colors. But I am having a problem with this: Error in calculadora_de_resistencias_electricas (line 8) if bandas([1,1])=='negro'*_
colores = input('Ingrese los colores de la resistencia eléctrica que desee calcular: ','s');bandas = split (colores, " ");disp(bandas);%%PRIMERA BANDA DE LA RESISTENCIA
if bandas(1,1)=='negro' bandas(1,1) = 0;endif bandas(1,1)=='cafe' bandas(1,1) = 1;endif bandas(1,1)=='rojo' bandas(1,1) = 2;endif bandas (1,1)=='naranja' bandas(1,1) = 3;endif bandas(1,1)=='amarillo' bandas(1,1) = 4;endif bandas(1,1)=='verde' bandas(1,1) = 5;endif bandas (1,1)=='azul' bandas(1,1) = 6;endif bandas(1,1)=='violeta' bandas(1,1) = 7;endif bandas(1,1)=='morado' bandas(1,1) = 7;endif bandas (1,1)=='gris' bandas(1,1) = 8;endif bandas(1,1)=='blanco' bandas(1,1) = 9;end
Best Answer