ThingSpeak

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

MATLAB Visualizations App

Visualize data from a ThingSpeak™ channel using MATLAB® functions and toolboxes listed in MATLAB Toolbox Access. 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 static MATLAB plots.

Visualize Data with MATLAB

  1. Click Apps > MATLAB Visualizations.

  2. Click New to get started your visualization.

  3. Select a template or an example with sample code, which you can run and explore the results.

  4. 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.

  • Add this Visualization to a Channel: Select your channels to add this visualization. Public visualizations can be added to the public view of your channel by selecting the Public View check box. Any visualization can be added to the private view of a channel with the Private View check box.

      Note:   For a visualization to appear in the public view of a channel, all three of these conditions must be met: the channel must be public, the visualization must be public, and the visualization must be added to the public view of the channel.

  • 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.

  • 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
This request displays the MATLAB visualization.

MATLAB Visualizations with Static Plots

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.

New to MATLAB?

See Also

Functions

Related Examples

More About

Was this topic helpful?