Error with selecting data in 3D matrix

I have a 3D matrix. The first dimension contains all datapoints (of markers, forces, moments,...), the second contains all the headers/names (of the markers, forces, moments,...) and the third dimension contains the x, y or z-coordinates. (x = 1, y = 2, z = 3).
I want to select all the datapoints for the MARKERS only (x-coordinates):
VideoSignals(:,1:strcmpi('*13', data_stair_rise(1,1).VideoSignals_headers),1)
So first I put ':' to select all the datapoints, but then I need to select ONLY the markers: they go from '1' to '*13' and last I select the x-coordinates using '1'.
It gives an error probably because of a wrong use of brackets I suppose. I tried several things... Help?

3 Comments

Sam - if your code is generating an error then please include the full error message in your question.
You mention that the second dimension contains the headers or names, so these must be strings - is that correct? For those that you are interested in, you say that the "go" from '1' to '*13'. What exactly do you mean by this? What does the asteroid mean in this context? Please provide some examples. I'm guessing that the error has something to do with the way that you are trying to index the second dimension. What do you expect the strcmpi to return?
The second dimensions contains strings. It contains 1 row and (for example) 220 columns. I need to select all the markers for 5 subjects. I have noticed in my headers, that the 'markers' and the 'forces' (in the second dimension) are seperated by a string '*136' or '*137' or '*138' or '*139'. So I thought I could use 'strcmpi' to say to the computer that he should take the columns going from '1' tot the strcmpi '*13'-column.
We need SPECIFICS, not generalizations and what you "thought"...
Give an example of the data you're trying to parse.
Presumimg VideoSignals is an array and not a function, then the expression
VideoSignals(:,1:_something_,1)
is an addressing expression that addresses all rows (the first ':') by columns of some vector 1 thru whatever the something expression evaluates to over the first plane.
strcmpi will return a vector of T:F where the comparison succeeds or fails in the vector given it. Thus you've written (presuming the strcmpi call even works) an addressing expression like
VideoSignals(:,1:[T F F F ... T ...],1)
This clearly isn't valid Matlab syntax as written so it won't be even if obfuscated by not having a variable to store the result of the function call into and use...
Think first, type later...
ADDENDUM
VideoSignals(:,1:[T F F F ... T ...],1) ... isn't valid Matlab syntax ...
But, if it really is what you're looking for,
VideoSignals(:,[T F F F ... T ...],1)
could be if the logical vector is of the right dimension and the assignment is written correctly so number elements of LHS is same as those of RHS.

Sign in to comment.

Answers (0)

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Tags

Asked:

Sam
on 3 Jan 2015

Edited:

dpb
on 4 Jan 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!