필터 지우기
필터 지우기

problem with 'if-elseif-else'

조회 수: 1 (최근 30일)
mar vouz
mar vouz 2016년 4월 27일
편집: Stephen23 2016년 4월 27일
In order to show the appropriate root for the problem I created this code :
if riza > 1 | riza<0
fprintf('so the correct root is',root1)
elseif riza1>1 |riza1<0
fprintf ('so the correct root',root)
end
Even though it appears the message 'so the correct root is' ,it won't appear the root1 or root.How can this be fixed ?

채택된 답변

KSSV
KSSV 2016년 4월 27일
% code
if riza > 1 | riza<0
fprintf('so the correct root is %f\n',root1)
elseif riza1>1 |riza1<0
fprintf ('so the correct root %f \n',root)
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by