This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function npary = mat2np(mat) | |
% convert matlab matrix to python (Numpy) ndarray | |
sh = fliplr(size(mat)); | |
mat2 = reshape(mat,1,numel(mat)); % [1, n] vector | |
npary = py.numpy.array(mat2); | |
npary = npary.reshape(sh).transpose(); % python ndarray | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Send-UdpDatagram | |
{ | |
Param ([string] $EndPoint, | |
[int] $Port, | |
[string] $Message) | |
$IP = [System.Net.Dns]::GetHostAddresses($EndPoint) | |
$Address = [System.Net.IPAddress]::Parse($IP) | |
$EndPoints = New-Object System.Net.IPEndPoint($Address, $Port) | |
$Socket = New-Object System.Net.Sockets.UDPClient |