indexing must appear last in an index expression ERROR
5 views (last 30 days)
I get this error : ()-indexing must appear last in an index expression. Line: available(b,6)... Column: 17
also I have this warning at that line : can not call or index into a temporary array.
I will be very thankful for any suggestion.
Guillaume on 12 Dec 2014
In matlab you can't chain indexing and as the error message tells you, you can't index temporaries. So you can't do
m(SomeIndexingOperation) is a temporary, and you can't index it further without assigning it to a variabe. So to resolve your problem, you first need to assign available(i,6) to a variable before ou can index into it:
temp = available(i, 6)
available(b, 6) = temp(min(...
That's one issue with your code. There are unfortunately more:
is the same as
find(something, 1) %but this is much faster
2. The code inside your find is suspicious. You usually don't have operators > and == in the same expression. As it is since the expression before the == is either 0 or 1 the == 1 does not do anything, so your expression is the same as
3. The line
does not do or assign anything since the result is not assigned to anything.