Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how do you count the number of zeros after the first 2 digits entered by a user and index that from a string matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
the p2 color guide map should help
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
%Task 2
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);
%fprintf('The Color Band for that resistnace are:'
if sum(Resistor1)==0
error('Terminate program')
end
end
댓글 수: 1
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!