MATLAB Visualizations App
Visualize data from a ThingSpeak™ channel using MATLAB® functions and products indicated in Access Add-Ons in MATLAB Analysis and Visualization Apps. You can view and explore data using interactive or static visualizations. You can also make the visualizations public and use the URL to embed them on websites. Create these interactive visualizations using the MATLAB Visualizations app:
Area plot
Line plot
Scatter plot
Stem plot
Plot with two stacked Y-axes
You also have access to many more display options from the MATLAB Plot Gallery.
Visualize Data with MATLAB
Click Apps > MATLAB Visualizations.
Click New to start your visualization.
Select a template or an example with sample code, which you can run and explore the results.
Click Create.
MATLAB Visualizations Settings
Name: Enter a unique name for your visualization. Press enter, or click outside the name box anytime you change the name and the stored name of your visualization is automatically updated.
MATLAB Code: Enter custom code, or modify the sample code with your data.
Create a public URL: Check this box to make this visualization public and generate a public URL to share your MATLAB visualization. If this box is checked, you can also add the visualization to the public view of your public channels.
AutoUpdate: Execute MATLAB code and update currently visible visualizations every five minutes. The visualizations you can automatically update include:
Visualizations added to the channel view
Visualizations opened in view mode
This check box is visible only to users with a paid ThingSpeak license.
Save and Run: Click to save and run your visualization.
Save: Click to save your visualization without running the code. An asterisk on this button indicates unsaved changes.
MATLAB Plot Output: This field displays your visualization.
Output: This field displays the output of your code. Use it to debug and modify your code.
Clear Output: Click to clear the visualization and the output.
Display Settings: You can add the visualization to your channel view. Expand Add/Edit this Visualization to a Channel to see a list of your channels.
To add the visualization to the private channel view, select Private View.
To show the visualization on a public view of a channel, make sure that the channel is public, and enable Create a public URL. Then select Public View for the channels you want to see the visualization on.
To update your selections, click Save Display Settings. All selected channels are shown in the section Show on Channel(s).
Delete: Click to delete the visualization. Deleting a visualization also deletes it from your channel view.
My Channels (right side of page) See information about your saved channels, including:
Channel name
Channel ID
Access
Write and Read API Keys
Channel fields
Help (right side of page)
Documentation: Click this tab for more information on using the MATLAB Visualizations app
New Channel: Create a new channel to hold the value of your analyzed data. After you save this channel, you automatically return to the same visualization app page, and the new channel appears in the Channel Info list.
Sizing of MATLAB Visualizations
To size your MATLAB visualization, send an HTTP GET request to
https://thingspeak.com/apps/matlab_visualizations/MATLAB_VIS_ID
,
replacing the MATLAB_VIS_ID
with your MATLAB visualization ID.
Valid parameters include:
width
(integer/string) — Width of the visualization, specified in pixels. (optional) The default width is 450 pixels. You can also pass'auto'
as an argument to change the visualization width and height to the width and height of the parent HTML element.height
(integer/string) — Height of the visualization, specified in pixels. (optional) The default height is 235 pixels. You can also pass'auto'
as an argument to change the visualization width and height to the width and height of the parent HTML element.
Note
The minimum and maximum values for width and height are 120 pixels and 5000 pixels respectively. If you provide only the height as an integer, width is calculated using the golden ratio 1.618 as height * 1.618. If you provide only the width as an integer, height is calculated as width / 1.618. If you apply the formula results to a width that is outside the minimum or maximum value, the visualization size defaults to 450 x 235 pixels.
Example of a GET request:
GET https://thingspeak.com/apps/matlab_visualizations/19889?width=1000&height=1200
Limitations
You cannot use ThingSpeak MATLAB interactive visualization functions with static MATLAB plots in the same code. Also, you can call only one plot function for a given visualization.
Data written to ThingSpeak channels in MATLAB visualizations must adhere to the posting rate limitations. You could lose data if you try to write to a channel multiple times within the period allowed by your license.
New to MATLAB?
Watch Getting Started with MATLAB video tutorial.
Learn interactively at MATLAB Academy.
Use additional static plots from the MATLAB Plot Gallery.
See Also
Functions
area
(MATLAB) |plot
(MATLAB) |stem
(MATLAB) |scatter
(MATLAB) |yyaxis
(MATLAB) |semilogy
(MATLAB)
Related Examples
- Remove and Visualize Outliers in Your Data
- Visualize Peaks in Your Data
- Visualize Abrupt Changes in Signals
- Visualize Path Traversed in Vector Maps
- Visualize Path Traversed in NASA Maps
- Visualize Distribution of Channel Data with a Box Plot
- Plot a Histogram with a Distribution Fit
- Generate Chirp Signal
- Visualize Linear Fit to Scattered ThingSpeak Data
- Visualize Wind Speed as a Function of Ambient Temperature and Pressure
- Visualize Simple Moving Average of Your Data
- Plot the MACD Indicator
- Visualize and Compare Measured and Predicted Tidal Depths
- Forecast Tidal Depths Using ThingSpeak Data
- Plot Error Histogram for a Neural Network
More About
- 2-D and 3-D Plots (MATLAB)
- Get Started with MATLAB (MATLAB)
- MATLAB