Quantcast
Channel: MATLAB Central Newsreader - tag:"table"
Viewing all articles
Browse latest Browse all 48

Re: suggestion for alternate syntax for table indexing

$
0
0
On 04/06/2017 3:01 PM, Bruce Elliott wrote:
...

> I'd like to be able to index into rows of a table using logical indexing
> on certain values in the table. Since the variables are in the table, I
> currently end up using this syntax:
>
> newSubTable =
> someTableWithAVeryLongName(someTableWithAVeryLongName.var1==testVal, :);
>
> I imagine this happens a lot when you're querying a table for row based
> on table values. It would be simpler if I could do this:
>
> newSubTable = someTableWithAVeryLongName(.var1==testVal, :);
>
> In other words, the dot before 'var1' would be interpreted to mean that
> what immediately follows is a variable name in the table being indexed.
>
> Thoughts?

I'd think something like the WITH...END block of VB or the like with
other database languages probably be the route to go; I've thought since
its inception as the initial Statistics Toolbox the statistical and like
syntax with Matlab has been awkward and difficult to use in comparison
to the "real" statistics packages. Granted keeping the matrix-oriented
vector syntax is an indispensible objective, it still seems as though
there ought to be a way to more inherently ingrain such into a more
user-friendly syntax.

Grouping variables need something similar to the SAS BY syntax in the
same vein.

--

Viewing all articles
Browse latest Browse all 48

Trending Articles