Is there a way where the matlab automatically stops after some time if it cant solved an equation? for example if im finding a value, but there is no possible value. so matlab becomes busy finding it. is there a way to stop it automatically?
No, not unless some sort of stopping condition (like elapsed time) has been programmed in like Wayne said. I know other products (like National Instruments I believe or other machine vision software meant for the manufacturing line) can interrupt a running function if it doesn't finish in the predefined time, but MATLAB does not have that capability.