load('P2_ColorGuide.mat')
Thicc=["Resistor", "Color Band"];
choice= menu('Is your input a resistance or a set of colorband',Thicc);
if (choice~=1)&&(choice~=2)
error('User did not select a value, program terminated')
end
if (choice == 1)
Resistor1 = input('Enter resistance in ohms as a vecttor');
R1 = ColorCode(Resistor1(:,1));
R2 = ColorCode(Resistor1(:,2));
find( Resistor1==0);
zero=numel(Resistor1);
Multiplier_= Multiplier{(length(Resistor1)-2)+1};
if sum(Resistor1)==0
error('Terminate program')
end
end
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/505684-array-indices-must-be-positive-integers-or-logical-values-error#comment_797741
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/505684-array-indices-must-be-positive-integers-or-logical-values-error#comment_797741
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/505684-array-indices-must-be-positive-integers-or-logical-values-error#comment_797748
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/505684-array-indices-must-be-positive-integers-or-logical-values-error#comment_797748
Sign in to comment.