how to assign different value for each input
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
confidence interval [0.9 0.95 0.99 0.999] and i want to ask the user to pick one of the these numbers, then i want to assign each number with corresponding c [1.645 1.960 2.576 3.291], how?
댓글 수: 0
답변 (1개)
James Tursa
2017년 5월 3일
Not quite sure what you really want, but here is a start:
ci = [0.9 0.95 0.99 0.999];
c = [1.645 1.960 2.576 3.291];
b = false;
while( ~b )
x = input(['Pick a number from ' num2str(ci) ' : ']);
[b,k] = ismember(x,ci);
if( b )
break;
end
disp('Number selected is not valid');
end
result = c(k);
댓글 수: 0
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!