I have talked about indexing a bunch of times in the past. Recently I have visited quite a few customers who still get tripped up a bit sometimes. So I thought I'd try again.... read more >>

# Indexing with Parentheses 3

Posted by **Loren Shure**,

Blogs

Posted by **Loren Shure**,

I have talked about indexing a bunch of times in the past. Recently I have visited quite a few customers who still get tripped up a bit sometimes. So I thought I'd try again.... read more >>

Posted by **Loren Shure**,

I just got asked a question about a good way to find the closest value in a vector that was less than a threshold. My solution is fairly short, and demonstrates some of my favorite MATLAB techniques. I will compare also show you an "obvious" solution.... read more >>

**Category:**- Indexing,
- Vectorization

Posted by **Loren Shure**,

I've talked about logical indexing before in some of the linked posts, but recent work makes me want to show it off again. One of the nice things about logical indexing is that it is very easy and natural to combine the results of different conditions to select items based on multiple criteria.... read more >>

**Category:**- Indexing

Posted by **Loren Shure**,

Recently on the MATLAB newsgroup, there was a thread asking how to split up a vector into pieces which were each monotonically increasing by the value 1. The post got several answers which I did not read first. Here's my thinking.... read more >>

**Category:**- Cell Arrays,
- How To,
- Indexing

Posted by **Loren Shure**,

Some calculations in MATLAB, including, for example, calculating local means or finite differences, or applying some other filter locally, operate on neighboring matrix elements. Doing so in an efficient manner is easy under the right conditions ... read more >>

**Category:**- Indexing

Posted by **Loren Shure**,

I've written a bunch of posts related to indexing, but I still haven't showed all the flexibility allowed. Today I'm going to add a variant to the list. ... read more >>

**Category:**- Indexing

Posted by **Loren Shure**,

I can think of a lot of functions that rearrange data in MATLAB. I've long suspected that not all of these are well-known, though some are clearly daily tools. Maybe it's time to be sure they get exposure. ... read more >>

Posted by **Loren Shure**,

In MATLAB, the simplest form of the function unique returns the unique values contained in a numeric vector, with the results sorted. This is often acceptable, but sometimes a user prefers the results in the order originally found in the data. ... read more >>

Posted by **Loren Shure**,

I've fielded some questions recently about how to coordinate multiple arrays changing simultaneously. One example is removing elements for two arrays in the case where either array holds a zero for the location. This is a good opportunity to reiterate ... read more >>

**Category:**- Indexing,
- Vectorization

Posted by **Loren Shure**,

The other day, one of my MathWorks buddies, Peter, asked me if I knew any tricks for vectorizing the notion of the colon (:) operator. For me, this sort of inquiry sometimes has an effect similar to waving a flag in front of a bull! The challenge was on. ... read more >>

**Category:**- Indexing,
- Readability,
- Vectorization

## Recent Comments