Can this be used?
if (size(cost,1) == 2 && size(limit,1) == 2)
Because I want to take the data from cost table and limit table. The cost table is 4 by 3 table and limit table is 4 by 2 table. So I want to take the data (which are input from user) from limit table. I have this coding:
if P1 < limit(1,1) P1 = limit(1,1); lambdanew = P1*2*cost(1,3) + cost(1,2);
I can only execute my program only if the user insert the data into limit table but if the user did not insert the data, so it will be an error saying this:
Index exceeds matrix dimensions.Error in ==> fyp_editor>Mybutton_Callback at 100 if P1 < limit(1,1)
So my question is how I want to make if statement for the limit table if the user did not enter the data? Is it limit(0)? limit = 0? limit == 0??
Best Answer