Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

Loren on the Art of MATLAB has been archived and will not be updated.

Posts 1 - 10 of 26

Results for: Indexing

Faster Indexing in Tables, datetime Arrays, and Other Data Types 9

Today I'd like to introduce a guest blogger, Stephen Doe, who works for the MATLAB Documentation team here at MathWorks. In today's post, Stephen discusses how to take advantage of recent performance improvements when indexing into tables. The same approach applies to many different data types. While the release notes describe the performance improvements, in today's post Stephen also offers further advice based on a simple code example.... read more >>

Repeated Indexing in MATLAB 4

Indexing is a popular topic I write about from time to time. Today I want to focus on what happens when there are duplicate indices.... read more >>

Get Smart, Be Logical! 1

Recently a customer asked me an interesting question about a good way to compute something. Before I sat down to tackle it, I happened to mention the problem to my pal, Sean. And he quickly answered, "max logical". It took me just a moment to realize what he was saying, and it is the answer to the problem. But when I heard it, I heard a person's name "Max Logical", and though I didn't know who that was, I immediately thought of Maxwell Smart, from the 60s tv comedy in the US, called "Get Smart".... read more >>

Indexing with Curly Braces 3

I have talked about indexing a bunch of times in the past, including my last post. 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

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 >>

Finding the Closest Value Less than a Threshold 15

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 >>

Logical Indexing – Multiple Conditions 22

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 >>

Partitioning a Vector 9

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 >>

Meet the Neighbors 13

Some calculations in MATLAB, including, for example, calculating local means or finite differences, or applying some other filter locally, operate on neighboring matrix... read more >>

Indexing – Mixing It Up 16

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 >>

Posts 1 - 10 of 26