Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Way to write expression????
Replies: 2   Last Post: Mar 19, 2013 1:34 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,296
Registered: 6/7/07
Way to write expression????
Posted: Mar 19, 2013 10:36 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Just had occasion responding to another posting where to check a
matching set of values had to nest calls to all() if were to get down to
a single value. Made me wonder if is any other syntax I'm overlooking...

Example...

x=rand(3,3,3);
y=some_function(size(x), inputs); % assume returns size(x) result

Now, question to be determined is whether plane_1 of x == plane_1 y?

Obviously

all(all(x(:,:,1))==all(all(y(:,:,1))

answers the question, but the question posed is there a way w/o the
nested all() that isn't at least or more verbose?

all(x(:,:,1)(:)) would be useful here but can't...

--



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.