You can create a function in Matlab that takes as input the coordinates of the object and the target coordinates, and then performs an action based on whether or not the object is at the target coordinates. Here is an example function that checks if an object is at the target coordinates (1,1):
main.m304 chars15 lines
You can call this function with the current coordinates of the object as follows:
main.m51 chars5 lines
This will print out whether the object is at the target location or not, and the isAtTarget
variable will contain a boolean value indicating whether the object is at the target location or not.
gistlibby LogSnag