> For the complete documentation index, see [llms.txt](https://emotiv.gitbook.io/extender-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://emotiv.gitbook.io/extender-manual/hardware_triggering/example-3-matlab.md).

# Example 3: MATLAB

The third example below shows how it is possible to install hardware support for Arduino into Matlab using the hardware support package and then directly control the output pin connected to the Extender.

![](/files/-Lu10HcJHkAw9HS28J_p)

1. Download and install Arduino Hardware support package on MATLAB.
2. Connect the Arduino board to the PC. To establish a connection between MATLAB and Arduino boards, the following command can be used from MATLAB:

   ```
   >> a = arduino
   ```
3. The arduino support package can control the arduino in multiple different ways. For this example we are using Digital pin 9 and using the writeDigitalPin command. See example below.&#x20;

   ```
   writeDigitalPin(a, D9, 1)
   writeDigitalPin(a, D9, 0)
   ```

This will create a rising edge which will trigger the extender port. You can incorporate this into your code.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://emotiv.gitbook.io/extender-manual/hardware_triggering/example-3-matlab.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
