Unable to use a value of type string as an index

조회 수: 7 (최근 30일)
Rithika Varma
Rithika Varma 2021년 10월 23일
댓글: VBBV 2021년 10월 23일
Where even is the string? I checked the datatypes of all the variables, and they're all either double or uint8.
  댓글 수: 3
VBBV
VBBV 2021년 10월 23일
Did you assign any numeric value to x in catbl1(catbl1=x)=div*c; ? Change also the line to catbl1(catbl1==x)=div*c;
VBBV
VBBV 2021년 10월 23일
If you don't have numeric value assigned to x it can also be problem

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

답변 (1개)

Scott MacKenzie
Scott MacKenzie 2021년 10월 23일
Inside your loop, change
catbl1(catbl1=x)=div*c;
to
catbl1(catbl1==x)=div*c;

제품

Community Treasure Hunt

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

Start Hunting!

Translated by