Prev: button press event on axes not firing after calling ginput
Next: Index arbitrage code/readings help please!
From: Komson on 9 Apr 2010 00:06 Are there any ways to access element in a matrix that returned from a function in a single statement ? >> magic(3) ans = 8 1 6 3 5 7 4 9 2 >> ans(1,1) ans = 8 How can I access element 1,1 of magic(3) without store the result of magic(3) into a variable ? I have tried "magic(3)(1,1)" and "(magic(3))(1,1)" but it does not work. Thanks in advance.
From: Matt Fig on 9 Apr 2010 00:16 Do a search of this NG, this question seems to be asked about once a month. Short answer is no, this cannot be done. Long answer is yes, it can be done with some kludge.
From: Komson on 9 Apr 2010 04:45
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hpm9mj$aa4$1(a)fred.mathworks.com>... > Do a search of this NG, this question seems to be asked about once a month. Short answer is no, this cannot be done. Long answer is yes, it can be done with some kludge. Thanks for your answer and sorry I did not search before asking the question. Here is the search result http://www.mathworks.com/matlabcentral/fileexchange/26570-direct-indexing-of-function-calls-oop-exercise http://www.mathworks.com/matlabcentral/newsreader/view_thread/275360 http://www.mathworks.com/matlabcentral/newsreader/view_thread/275618 |