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