Starting in r2020a, AppDesigner buttons and TreeNodes can display animated GIFs, SVG, and truecolor image arrays.

Every component in the App above is either a Button or a TreeNode!

Prior to r2020a the icon property of buttons and TreeNodes in AppDesigner supported JPEG, PNG, or GIF image files specified by a character vector or string array but did not support animation.

Here's how to display an animated GIF, SVG, or truecolor image in an App button or TreeNode starting in r2020a. And for the record, "GIF" is pronounced with a hard-g .

Display an animated GIF

Select the button or TreeNode from within AppDesigner > Design View and navigate to Component Browser > Inspector > Button dropdown list of properties (shown below). Select an animated GIF file and set the text and icon alignment properties.

To set the icon property programmatically,

app.Button.Icon = 'launch.gif';  % or "launch.gif"

The filename can be an image file on the Matlab path (see addpath ) or a full path to an image file.

Display SVG

Use “scalable vector graphics” files for high-resolution images that are scaled to different sizes while preserving their shape and retaining their clarity. A quick and easy way to remember which plotting function is assigned to each button in an app is to assign an image of the plot to the button.

After creating the figure, expand the axes by setting the position or outerposition property to [0 0 1 1] in normalized units and save the figure using File > Save as and select svg format. Save the image to the folder containing your app. Then follow the same procedure as animated GIFs.

Display truecolor image

A truecolor image comes in the form of an [m x n x 3] array where each m x n pixel color is specified by an RGB triplet (read more) . This feature allows you to dynamically create a digital image or to upload an image from a mat file rather than an image file.

In this example, a progress bar is created within the uibutton callback function and it’s updated within a loop. For a complete demo of this feature see this comment .

% Button pushed function: ProcessDataButton
function ProcessDataButtonPushed(app, event)
    % Change button name to "Processing"
    app.ProcessDataButton.Text = 'Processing...';
    % Put text on top of icon
    app.ProcessDataButton.IconAlignment = 'bottom';
    % Create waitbar with same color as button
    wbar = permute(repmat(app.ProcessDataButton.BackgroundColor,15,1,200),[1,3,2]);
    % Black frame around waitbar
    wbar([1,end],:,:) = 0;
    wbar(:,[1,end],:) = 0;
    % Load the empty waitbar to the button
    app.ProcessDataButton.Icon = wbar;
    % Loop through something and update waitbar
    n = 10;
    for i = 1:n
        % Update image data (royalblue)
        % if mod(i,10)==0 % update every 10 cycles; improves efficiency
         currentProg = min(round((size(wbar,2)-2)*(i/n)),size(wbar,2)-2);
         RGB = app.ProcessDataButton.Icon;
         RGB(2:end-1, 2:currentProg+1, 1) = 0.25391; % (royalblue)
         RGB(2:end-1, 2:currentProg+1, 2) = 0.41016;
         RGB(2:end-1, 2:currentProg+1, 3) = 0.87891;
           app.ProcessDataButton.Icon = RGB;
          % Pause to slow down animation
          % end
      % remove waitbar
      app.ProcessDataButton.Icon = '';
      % Change button name
      app.ProcessDataButton.Text = 'Process Data';

The for-loop above was improved on Feb-11-2022.

Credit for the black & teal GIF icons: lordicon.com

MATLAB (Way to go!!! You rock!)
Python (not from within MATLAB)
Any variation of C
Java, Javascript
R, Ruby, Swift, Go, Scala, PHP, VB
Other not mentioned, or mixture
10577 votes
Last activity on 20 May 2024 at 13:51

Adam Danz
Adam Danz
Last activity on 17 May 2024 at 18:05

We're thrilled to unveil a new feature in the MATLAB Central community: User Following.
Our community is so lucky to have many experienced MATLAB experts who generously share their knowledge and insights across different applications, including Answers, File Exchange, Discussions, Contests, or Blogs.
With the introduction of User Following feature, you can now easily track new content across different areas and engage in discussions with people you follow. Simply click the ‘Follow’ button located on their profile page to start.
Depending on your communication setting, you will receive notifications via email and/or view updates in your ‘Followed Activity’ feeds. To tailor your feed, select the ‘People’ filter and focus on activities from those you follow.
We strongly encourage you to take advantage of the User Following feature to foster learning and collaboration within our vibrant community.
Who will be the first person you choose to follow? Share your answer in the comments section below and let's inspire each other to explore new horizons together.

Welcome to MATLAB Central's first Ask Me Anything (AMA) session! Over the next few weeks, I look forward to addressing any questions or curiosities you might have about MATLAB, the forum, sasquatches, or whatever's on your mind. Having volunteered as a contributor to this community before joining MathWorks, I'm excited to act as a bridge between these two worlds. Let's kick things off by sharing a little-known fact about the forum’s staff contributors!
A couple of years ago, before I joined MathWorks as a developer on the Graphics and Charting team, I often wondered who were the MathWorkers with the [staff] moniker answering questions in the Answers forum. Is their MATLAB Central activity part of their day-to-day job expectations? Do they serve specific roles on some kind of community outreach team? Is their work in the forum voluntary in the same way that non-staff contributors volunteer their time?
Now that I'm on the inside, I'd like to share a secret with my fellow MATLAB users and MATLAB Central enthusiasts: with the exception of the MathWorks Support Team, staff participation in the Answers forum is completely voluntary! The staff contributions you see in the forum arise from pure intrinsic motivation to connect with users, help people out of ruts, and spread the word about our product!
For example, Steven Lord has contributed 20-150 answers per month for 9 years! Steven is a quality engineer for core MATLAB numerical functions. Cris LaPierre develops training material and has been a faithful contributor in the forum for almost 6 years! Kojiro Saito and Akira Agata have been tackling Japanese content for more than 7 years! There are many others who have inspired me as a user, and I am honored to now call colleagues: Peter Perkins, Michio, Joss Knight, Alan Weiss, Jiro Doke, Edric Ellis, and many others who deserve appreciation.
The forum's success hinges on the invaluable contributions from the majority of non-staff volunteers, whose dedication and expertise fuel our community. But I know I wasn't alone in wondering about these staff contributors, so now you're in on the secret!
I'm curious to know what other topics you're interested in learning about. Ask me anything!
Last activity on 8 May 2024 at 13:26

Hey MATLAB Community! 🌟
In the vibrant landscape of our online community, the past few weeks have been particularly exciting. We've seen a plethora of contributions that not only enrich our collective knowledge but also foster a spirit of collaboration and innovation. Here are some of the noteworthy contributions from our members.

Interesting Questions

Victor encountered a puzzling error while trying to publish his script to PDF. His post sparked a helpful discussion on troubleshooting this issue, proving invaluable for anyone facing similar challenges.
Devendra's inquiry into interpolating and smoothing NDVI time series using MATLAB has opened up a dialogue on various techniques to manage noisy data, benefiting researchers and enthusiasts in the field of remote sensing.

Popular Discussions

Adam Danz's AMA session has been a treasure trove of insights into the workings behind the MATLAB Answers forum, offering a unique perspective from a staff contributor's viewpoint.
The User Following feature marks a significant enhancement in how community members can stay connected with the contributions of their peers, fostering a more interconnected MATLAB Central.

From File Exchange

Robert Haaring's submission is a standout contribution, providing a sophisticated model for CO2 electrolysis, a topic of great relevance to researchers in environmental technology and chemical engineering.

From the Blogs

Sivylla's comprehensive post delves into the critical stages of AI model development, from implementation to validation, offering invaluable guidance for professionals navigating the complexities of AI verification.
In this engaging Q&A, Ned Gulley introduces us to Zhaoxu Liu, a remarkable community member whose innovative contributions and active engagement have left a significant impact on the MATLAB community.
Each of these contributions highlights the diverse and rich expertise within our community. From solving complex technical issues to introducing new features and sharing in-depth knowledge on specialized topics, our members continue to make MATLAB Central a vibrant and invaluable resource.
Let's continue to support, inspire, and learn from one another
Last activity on 30 Apr 2024 at 15:40

We are thrilled to announce the launch of a brand-new area within the MATLAB Central community – 'Discussions'. This exciting addition is designed to foster a stronger and more connected community.
Discover the 'Tips & Tricks' Channel
At the heart of 'Discussions' is the 'Tips & Tricks' channel. This is your ultimate destination for both sharing and discovering the best MATLAB tips.
Whether you're a seasoned MATLAB user with wisdom to share or a newcomer seeking advice, this channel is your platform. Here, you can post your own insights, ask for guidance on specific topics, and uncover hidden gems that can transform your MATLAB experience. It's more than just a channel; it's a community learning together; it’s your community blog!
More Than Just Tips
The 'Discussions' area offers much more. Explore the 'Ideas'channel to share and debate innovative product ideas. Dive into the 'Fun'channel to enjoy memes and light-hearted content with fellow MATLAB enthusiasts. Or wander into 'Off Topic'for intriguing discussions that might not be related to MATLAB.
Follow the channels!
We highly encourage every member of the MATLAB Central community to follow the channels you are interested in and participate in 'Discussions'. Together, we can achieve more, learn more, and connect more.
ismissing( { [ ] } )
ismissing( NaN )
ismissing( NaT )
ismissing( missing )
ismissing( categorical(missing) )
ismissing( { '' } ) % 2 apostrophes
896 votes
eye(3) - diag(ones(1,3))
0 ./ ones(3)
cos(repmat(pi/2, [3,3]))
A(3, 3) = 0
mtimes([1;1;0], [0,0,0])
3009 votes
Hey MATLAB Community! 🌟
As we continue to explore, learn, and innovate together, it's essential to take a moment to recognize the remarkable contributions that have sparked engaging discussions, solved perplexing problems, and shared insightful knowledge in the past two weeks. Let's dive into the highlights that have made our community even more vibrant and resourceful.

Interesting Questions

Burhan Burak brings up an intriguing issue faced when running certain code in MATLAB, seeking advice on how to refactor the code to eliminate a warning message. It's a great example of the practical challenges we often encounter
Jenni asks for guidance on improving linear models to fit data points more accurately. This question highlights the common hurdles in data analysis and model fitting, sparking a conversation on best practices and methodologies.

Popular Discussions

A thought-provoking question posed by goc3 that delves into the intricacies of MATLAB's logical operations. It's a great discussion starter that tests and expands our understanding of MATLAB's behavior.
Toshiaki Takeuchi shares an insightful visualization of the demand for MATLAB jobs across different regions, based on data from LinkedIn. This post not only provides a snapshot of the job market but also encourages members to discuss trends in MATLAB's use in the industry.

From the Blogs

Mike Croucher shares his excitement and insights on two long-awaited features finally making their way into MATLAB R2024a. His post reflects the passion and persistence of our community members in enhancing MATLAB's functionality.
In this informative post, Sivylla Paraskevopoulou offers practical tips for speeding up the training of deep learning models. It's a must-read for anyone looking to optimize their deep learning workflows.
A Heartfelt Thank You 🙏
To everyone who asked a question, started a discussion, or wrote a blog post: Thank you! Your contributions are what make our community a fountain of knowledge, inspiration, and innovation. Let's keep the momentum going and continue to support each other in our journey to explore the vast universe of MATLAB.
Happy Coding!
Note: If you haven't yet, make sure to check out these highlights and add your voice to our growing community. Your insights and experiences are what make us stronger.
isempty( [ ] )
isempty( { } )
isempty( '' ) % 2 single quotes
isempty( "" ) % 2 double quotes
c = categorical( [ ] ); isempty(c)
s = struct("a", [ ] ); isempty(s.a)
1324 votes
Congratulations, @Fangjun Jiang for achieving 10K reputation points.
You reached this milestone by providing valuable contribution to the community since you started answering questions in Since September 2011.
You were very active in the first year, and took some break, but you steadily rose ranks in the recent years to achieve this milestone.
You provided 3954 answers and received 1503 votes. You are ranked #25 in the community. Thank you for your contribution to the community and please keep up the good track record!
MATLAB Central Team
In honor of National Pet Day on April 11th, we're excited to announce a fun contest that combines two of our favorite things: our beloved pets and our passion for MATLAB/Simulink! Whether you're a cat enthusiast, a dog lover, or a companion to any other pet, we invite you to join in the fun and showcase your creativity.
How to Participate:
  • Take a photo of your pet featuring any element of MATLAB/Simulink.
  • Post it in the Fun channel of the Discussions area.
  • Include a brief description or story behind the photo - we love to hear about your pets and your creative process!
🏆 Prizes:
We will be selecting 3 winners for this contest, and each winner will receive a MathWorks T-shirt or hat! Winners will be chosen based on creativity, originality, and how well they incorporate the MATLAB/Simulink element into their photo.
📅Important Dates:
Contest ends on April 12th, 2024, at 11:59:59 pm, Eastern Time
We can't wait to see all of your adorable and creative pet photos. Let's celebrate National Pet Day in true MathWorks style. Good luck, and most importantly, have fun!
union(v, [ ])
intersect(v, v)
setdiff(v, [ ])
All return sorted output
1193 votes