Unable to use a value of type string as an index

Where even is the string? I checked the datatypes of all the variables, and they're all either double or uint8.

3 Comments

See the output what you get
size(catbl,1)
by typing in command window which you are using in for loop
Did you assign any numeric value to x in catbl1(catbl1=x)=div*c; ? Change also the line to catbl1(catbl1==x)=div*c;
If you don't have numeric value assigned to x it can also be problem

Sign in to comment.

Answers (1)

Inside your loop, change
catbl1(catbl1=x)=div*c;
to
catbl1(catbl1==x)=div*c;

Products

Asked:

on 23 Oct 2021

Commented:

on 23 Oct 2021

Community Treasure Hunt

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

Start Hunting!