In MATLAB, you can use the built-in ping
function to send ICMP echo request packets to a target host, and measure the round-trip time for the responses. Here's an example of how to use it:
main.m411 chars13 lines
This will output something like:
main.m52 chars2 lines
Note that the ping
function sends four packets by default, and returns the average round-trip time (rtt
) in milliseconds. You can customize the number of packets and other options using name-value pairs (see the documentation for more details).
gistlibby LogSnag