# am I having an matrix dimension because the name of the output ('III')?

조회 수: 1(최근 30일)
DulceEien 2021년 7월 29일
댓글: DulceEien 2021년 7월 29일
Matrix dimensions must agree.
% Deficiency rating
if extent < 1
deficiency = 'OK';
elseif extent >= 1 && extent < 5
deficiency = 'IV';
elseif extent >= 5 && extent < 20
deficiency = 'III';
elseif extent >= 20 && extent < 50
deficiency = 'II';
elseif extent >= 50 && extent < 100
deficiency = 'I';
end
% Reducing ratio
if deficiency == 'OK'
alpha = 0;
elseif deficiency == 'IV'
alpha = 0.05;
elseif deficiency == 'III'
alpha = 0.20;
elseif deficiency == 'II'
alpha = 0.50;
elseif deficiency == 'I'
alpha = 1;
end
First I'm assigning a string value and then I will assign a numerical value according to it but I'm getting an error

댓글을 달려면 로그인하십시오.

### 채택된 답변

KSSV 2021년 7월 29일
strcmp(deficiency,'OK')
deficiency == 'OK'
##### 댓글 수: 1표시숨기기 없음
DulceEien 2021년 7월 29일
thank you so much

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

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

Start Hunting!