søn, 03 02 2008 kl. 17:31 +0330, skrev hossein sajjadi: > Hi, Soren > OK, I make a mistake .The correct is > >ans= > >2 2 2 2 okay, then I understand.
> but please read the note again from this point forward. Okay, so you are suggesting that if a = 4:6 b = [2,2,2,2] then a(b)++ should be the same as a(2) += length(b) right? I don't really agree here. The way I read the ++ operator is as a simple shorthand for += 1, which again is a shorthand for, say, a = a + 1. So, a(b)++ should be read as a(b) = a(b) + 1 Now, let us look at the expression a(b) = 7 What would you expect this would do? I think the result of this should be a = [4, 7, 6] Now, we return to the a(b) = a(b) + 1 case. The right hand side of the expression is [6, 6, 6, 6] So the expression is a([2,2,2,2]) = [6, 6, 6, 6] You seem to be claiming that this should result in a = [4, 9, 6] right? I don't think that is a meaningful result. So, while I understand why you would want the ++ operator to behave like you described, I don't think it would be consistent with the rest of the language. Søren ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Octave-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/octave-dev
