i created a from block to call the target_table and use the from block as a input of Trial_Control. To get the x y value of home position, can i just make x position=target_table[1][1] or x position=target_table[1][col_x] to get the x value of home?(assume the home target is in the first row of target table)
1 Answers
In Trial_Control (which is a C based Stateflow block), the default array numbering is 0 based (this is unlike the rest of Simulink, which is 1 based).
For it to work the way you're describing (and I recommend you do this), open up Model Explorer and click on Trial_Control. Then select target_table and click on the Description tab and set First Index to 1.
I've attached a diagram to help you navigate (the option is placed quite out of the way, in my opinion)

thank you! but after that how can i get the value of x and y? just call x=Target_Table[1][1] and y=Target_Table[1][2]?
Yep – that will get you the first row x and y.
Please login or Register to submit your answer