stateIDS = state2index(graph,states)
finds the state indices stateIDS for the queried state vectors
states, if they exist in the navGraph object
graph.
The navGraph states table contains a state corresponding to the first state data, so the function returns its index. However, the states table does not contain a state that corresponds to the second state, so the function returns 0.
State vectors, specified as a matrix in which each row represents a state vector.
The state vectors must be of the same size as those in the
StateVector column of the States table
in the navGraph object
graph.
stateIDS — State indices column vector of positive integers
State indices, returned as a column vector of positive integers. When the function
does not find a specified state vector, the value for the corresponding element in
stateIDS is 0.
Data Types: double
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.