Skip to content

Instantly share code, notes, and snippets.

Dev-iL /
Last active Nov 10, 2021
Adding an arbitrary .js library to your uifigure during runtime (R2018a)


This gist demonstrates how we can attach the D3 library, provided as a remote .js file, to our uifigure and use it to create some interesting visualizations. The JS code in this example is taken almost verbatim from the Particles example, found inside the D3 example gallery.


  1. Save the three code files (.m, .js, .css) in the same folder, and execute the MATLAB script.
  2. If there is some error such as
    Error using matlab.internal.webwindow/executeJS (line 730)

Error executing JavaScript command:

Dev-iL /
Last active Nov 1, 2020
Hijacking uicontrols to do our bidding...

In this example I demonstrate how we can respond to JS events within MATLAB. Here's a preview of what is possible using this approach:

demoNum = 4

Take a look at the code below, which was tested on R2018a. Please save all files in the same folder, and run it using jsEventDemo(demoNum), where demoNum is 1...4.

function varargout = jsEventDemo(demoNum)
%% Handle inputs and outputs
if ~nargin

In this document I'm going to discuss how to get a AWUS036ACH wifi adapter up and running in monitor mode in Kali Linux 2017.2.

  1. Clean install Kali 2017.2.

  2. Upgrade packages:

This is required mostly to update the linux headers so that we can build the driver we download afterwards.

apt update