Find successive state indices and costs
Find Successive State Indices and Costs in
navGraph data for states and links.
Find successive state indices and costs based on a state name.
[succIDS,costs] = successors(navGraphObj,"G")
succIDS = 2×1 1 8
costs = 2×1 38.7759 13.9383
Find the state vectors of the successive states.
states = index2state(navGraphObj,succIDS)
states = 2×3 8.0000 2.0000 0.7218 8.0000 7.0000 0.6741
currID — Current state
positive integer | string scalar | character vector
Current state, specified as a positive integer, representing a state index, or as a string scalar or character vector representing a state name.
succIDS — Successive state indices
column vector of positive integers
Successive state indices, returned as a column vector of positive integers.
costs — Cost of all successive states
numeric column vector
Cost of all successive states, returned as a numeric column vector of the same size
succIDS. The function computes costs using the
property of the
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Introduced in R2023a