Inicie sesión para participar
Hello and a warm welcome to all! We're thrilled to have you visit our community. MATLAB Central is a place for learning, sharing, and connecting with others who share your passion for MATLAB and Simulink. To ensure you have the best experience, here are some tips to get you started:
- Read the Community Guidelines: Understanding our community standards is crucial. Please take a moment to familiarize yourself with them. Keep in mind that posts not adhering to these guidelines may be flagged by moderators or other community members.
- Ask Technical Questions at MATLAB Answers: If you have questions related to MathWorks products, head over to MATLAB Answers (new question form - Ask the community). It's the go-to spot for technical inquiries, with responses often provided within an hour, depending on the complexity of the question and volunteer availability. To increase your chances of a speedy reply, check out our tips on how to craft a good question (link to post on asking good questions).
- Choosing the Right Channel: We offer a variety of discussion channels tailored to different contexts. Select the one that best fits your post. If you're unsure, the General channel is always a safe bet. If you feel there's a need for a new channel, we encourage you to suggest it in the Ideas channel.
- Reporting Issues: If you encounter posts that violate our guidelines, please use the 🚩Flag/Report feature (found in the 3-dot menu) to bring them to our attention.
- Quality Control: We strive to maintain a high standard of discussion. Accounts that post spam or too much nonsense may be subject to moderation, which can include temporary suspensions or permanent bans.
- Share Your Ideas: Your feedback is invaluable. If you have suggestions on how we can improve the community or MathWorks products, the Ideas channel is the perfect place to voice your thoughts.
Enjoy yourself and have fun! We're committed to fostering a supportive and educational environment. Dive into discussions, share your expertise, and grow your knowledge. We're excited to see what you'll contribute to the community!
I have started a blog series on the history of image display in MATLAB. If this topic interests you, and if there is something in particular you would like me to address in the series, let me know.
This topic is for discussing highlights to the current R2025a Pre-release.
I'm planning to start a personal scientific software project. I used to be familiar with Matlab (quite some time ago), so Matlab would be my first choice. But I keep hearing that Matlab is old stuff and I should use Julia or something like that. I wouldn't find learning Julia difficult, so familiarity with Matlab is not an important factor. Neither is cost, because I can afford a home license for Matlab, Simulink and a few toolboxes. So I'm thinking. Please give me your input! Why should I use Matlab in 2025 instead of alternatives?
In a discussion on LInkedin about my recent blog post, Do these 3 things to increase the reach of your open source MATLAB toolbox, I was asked by "Could you elaborate on why someone might consider opening/sharing their code? Thinking of early-career researchers, what might be in it for them?"
I'll give my answer here but I'm more interested in yours. How would you have answered this?
This is what I said:
- It's the right thing to do scientifically. A computational paper is essentially just an advertisement of what you've done. The code contains vital details about how you actually did it. A computational paper is incomplete without the code.
- If you only describe your algorithm in a paper, I have to implement it before I can apply your research to my problem. If you share the code, I can get started much more quickly using your research. This means I publish faster and since I am a good scientist, this means you get cited faster.
- Other scientists start off as users of your code. This leads to citations. Over time, some of them start deeply using and modifying your code, this leads to collaborators.
- Once you decide to share code via something like GitHub, you quickly start adopting good software engineering practices without initially realizing it. This improves the quality of your research since adopting good software practices makes it more likely that your software will give the right answers.
That last point can be a little hard to get your head around sometimes. Even if all you do is use file upload to get your stuff onto GitHub (i.e. you're not using git properly yet) you will start to naturally converge towards better code.
Why? Because as soon as you share code, you have to solve the problem of getting it to run on someone else's machine.
A trivial example concerns hard coded paths, for example. If you only ever run it on your machine then having a line like datafile = "C:\Mystuff\data.csv" always works but it breaks as soon as I try to run it on my machine. You'll look at this and think "Maybe there's a better way to do that".
Similarly dependencies. Your Path may be full of stuff that isn't present on my machine. As soon as I try to run your code, it won't work and you'll have to figure out how to handle dependencies in a reproducible way.
Documentation! An empty README.md is no good if you expect me to know how to use your code. You at least have to say something like "To run this, type runme(N) into MATLAB where N is the size of the model...etc etc)
The act of sharing, and dealing with the consequences, leads to much better code than if you keep it to yourself.
Due to MATLAB being banned in some mainland Chinese universities in 2020, in recent years a Chinese company called "Suzhou Tongyuan SoftControl" has completely imitated MATLAB’s behavior. Below are some screenshots as evidence. What is your opinion on this issue?



Source: Syslab 帮助文档-苏州同元软控
This week's Graphics and App Building blog article guides chart authors and app builders through the process of designing for a specific theme or creating theme-responsive charts and apps.
- Learn how dark theme may impacts charts and apps
- Discover best practices for theme-adaptive workflows
- Step-by-step examples for both script-based plots and advanced custom charts and UI components
- Discover new tools like ThemeChangedFcn, getTheme, and fliplightness
So you've downloaded the R2025a pre-release, tried Dark mode and are wondering what else is new. A lot! A lot is new!
One thing I am particularly happy about is the fact that Apple Accelerate is now the default BLAS on Apple Silicon machines. Check it out by doing
>> version -blas
ans =
'Apple Accelerate BLAS (ILP64)'
If you compare this to R2024b that is using OpenBLAS you'll see some dramatic speed-ups in some areas. For example, I saw up to 3.7x speed-up for matrix-matrix multiplication on my M2 Mabook Pro and 2x faster LU factorisation.
Details regarding my experiments are in this blog post Life in the fast lane: Making MATLAB even faster on Apple Silicon with Apple Accelerate » The MATLAB Blog - MATLAB & Simulink . Back then you had to to some trickery to switch to Apple Accelerate, now its the default.
I’m quite curious as to why this particular email was sent directly to my personal inbox. I have never actively subscribed to any online or offline training services nor clicked on any related marketing links. Could it be that because I frequently visit the official MATLAB forums, someone has identified me as a potential customer for their targeted promotions?

I’d love to hear your thoughts and start a discussion on this!
One of MATLAB's strengths is how easy it is to document a custom function/class. The first continuous comment block is automatially displayed by the help and doc functions, with some neat automatic formatting. For example:
% myFunc My example function
%
% This function does not do anything yet, but one day will be great. For
% example, you will be able to type:
% out=myFunc(in1,in2);
% and something cool will happen.
%
% See also otherFunc
function varargout=myFunc(varargin)
% actual code
end
will have a link to the documentation for "otherFunc", assuming that file exists. Class documentation is nicely broken up into a header (with "See also" support) followed by a property and method summary.
All the above works great with one big exception: apart from highlighting uses of the file's name, there is no way to display anything but pure text. No Markdown, no LateX, and so forth. It is possible to sneak an HTML link into the comment block, calling a MATLAB command that can display a live script with fancy formatting. I have done this in the past, although it can be a little tricky for files inside a package/namespace (folders beginning with '+').
I can envision a system where fancy documentation would be buried inside an "example" subfolder where "myFunc.m" is located. Invoking "showExample myFunc", where "showExample" is a to-be-written utility, would look for a live script inside the appropriate subfolder, make a local copy for the user to tinker with, and then display that local copy in the MATLAB editor. Since the actual function function and its example woulld obviously inside a Git repository, text-based live scripts would be used instead of an *.mlx file.
Again, this all works fine on its fine on its own, but it would be very difficult to replicate the "See also" capability or the other features of the standard doc function. So what are we to do? Is there a clever way to add another block to a standard comment block "See examples" that would automatically detect scripts in a subfolder of function/class being queried?
I know there is a way to incorporate custom documentation into MATLAB help system. This is much too cumbersome for my purposes, where many functions/classes are being added/edited all the time. The existing doc system covers maybe 80% of my needs, but sometimes a little math (LaTeX) would go a long way on explaining how things work.
T < 2 years
38%
2 years < T < 5 years
26%
5 years < T < 10 years
18%
10 years < T < 20 years
11%
T > 20 years
8%
10172 votos
In case you missed it in my overview of the MATLAB R2025a release, Markdown support has been greatly improved. This picture says it all

The attached code is an animated solution of the three body problem. On 2024b it runs perfectly fine. When we tried it on 2025a, the animation constantly hitches, the CPU usage is almost double and the runtime is much slower. The curves also look less detailed and jagged in some places. When we run it without drawing anything, the performance seems comparable between versions, but still slightly slower. All of this behavior persists across different hardware. Anybody else having this kind of problem with the new release? I'm suspecting the graphics backend changes may be the culprit here...
clc
clear
close
syms t x1(t) y1(t) x2(t) y2(t) x3(t) y3(t)
G = 6.6743 * 10^-11;
%epsilon = 1e-4
m1 = 10^12;
m2 = 1*10^12;
m3 = 1*10^12;
r1 = [x1(t),y1(t)];
K1 = 1/2 * m1 * (diff(x1(t),t)^2 + diff(y1(t),t)^2);
r2 = [x2(t),y2(t)];
K2 = 1/2 * m2 * (diff(x2(t),t)^2 + diff(y2(t),t)^2);
r3 = [x3(t),y3(t)];
K3 = 1/2 * m3 * (diff(x3(t),t)^2 + diff(y3(t),t)^2);
L1x = diff(diff(K1,diff(x1(t),t)) , t);
L1y = diff(diff(K1,diff(y1(t),t)) , t);
L2x = diff(diff(K2,diff(x2(t),t)) , t);
L2y = diff(diff(K2,diff(y2(t),t)) , t);
L3x = diff(diff(K3,diff(x3(t),t)) , t);
L3y = diff(diff(K3,diff(y3(t),t)) , t);
r12 = r2 - r1;
r13 = r3 - r1;
r23 = r3 - r2;
dlugosc_r12 = sqrt(r12(1)^2 + r12(2)^2);
dlugosc_r13 = sqrt(r13(1)^2 + r13(2)^2);
dlugosc_r23 = sqrt(r23(1)^2 + r23(2)^2);
Q12 = G * m1 * m2 / dlugosc_r12^2 * (r2-r1)/dlugosc_r12;
Q13 = G * m1 * m3 / dlugosc_r13^2 * (r3-r1)/dlugosc_r13;
Q23 = G * m2 * m3 / dlugosc_r23^2 * (r3-r2)/dlugosc_r23;
Q21 = -Q12;
Q32 = -Q23;
Q31 = -Q13;
Q1 = Q12 + Q13;
Q2 = Q21 + Q23;
Q3 = Q31 + Q32;
eqn_1_x = L1x == Q1(1);
eqn_1_y = L1y == Q1(2);
eqn_2_x = L2x == Q2(1);
eqn_2_y = L2y == Q2(2);
eqn_3_x = L3x == Q3(1);
eqn_3_y = L3y == Q3(2);
syms X1 Y1 X2 Y2 X3 Y3
Q1_num = subs(Q1,[x1(t), y1(t), x2(t), y2(t), x3(t), y3(t)],[X1, Y1, X2, Y2, X3, Y3]);
Q2_num = subs(Q2,[x1(t), y1(t), x2(t), y2(t), x3(t), y3(t)],[X1, Y1, X2, Y2, X3, Y3]);
Q3_num = subs(Q3,[x1(t), y1(t), x2(t), y2(t), x3(t), y3(t)],[X1, Y1, X2, Y2, X3, Y3]);
syms vx1 vy1 vx2 vy2 vx3 vy3
state_dot = [
vx1;
vy1;
vx2;
vy2;
vx3;
vy3;
Q1_num(1)/m1;
Q1_num(2)/m1;
Q2_num(1)/m2;
Q2_num(2)/m2;
Q3_num(1)/m3;
Q3_num(2)/m3
];
f = matlabFunction(state_dot, 'Vars', {sym('t'), [X1; Y1; X2; Y2; X3; Y3; vx1; vy1; vx2; vy2; vx3; vy3]});
u0 = [-1e5; %x1
0; %y1
1e5; %x2
0; %y2
0; %x3
sqrt(3)*1e5; %y3
-11/2 * 1e-3; %vx1
11/2*sqrt(3)*1e-3; %vy1
-11/2 * 1e-3; %vx2
-11/2*sqrt(3)*1e-3; %vy2
11e-3; %vx3
0]; %vy3
tspan = [0, 1e9];
%options = odeset('RelTol', 1e-15, 'AbsTol', 1e-20);
[t_sol, u_sol] = ode45(f, tspan, u0);
t_anim = linspace(t_sol(1), t_sol(end), 5000);
u_anim = interp1(t_sol, u_sol, t_anim);
%%
% figure;
tor_1 = plot(u_anim(:,1), u_anim(:,2), 'r', 'LineWidth',1.5); hold on;
tor_2 = plot(u_anim(:,3), u_anim(:,4), 'g', 'LineWidth',1.5);
tor_3 = plot(u_anim(:,5), u_anim(:,6), 'b', 'LineWidth',1.5);
% xlabel('x [m]');
% ylabel('y [m]');
% legend('Ciało 1', 'Ciało 2', 'Ciało 3');
% title('Trajektorie ciał w układzie trzech ciał');
% axis equal
% grid on;
pozycja_1 = plot(u_anim(1,1),u_anim(1,2),'ro','markersize',10,'markerface','r'); hold on
pozycja_2 = plot(u_anim(1,3),u_anim(1,4),'go','markersize',10,'markerface','g');
pozycja_3 = plot(u_anim(1,5),u_anim(1,6),'bo','markersize',10,'markerface','b');
% xlim([-2e5,2e5])
% ylim([-2e5,2e5])
axis equal
for i = 1 : 1 : length(t_sol)
set(pozycja_1,'XData', u_anim(i,1),'YData', u_anim(i,2));
set(pozycja_2,'XData', u_anim(i,3),'YData', u_anim(i,4));
set(pozycja_3,'XData', u_anim(i,5),'YData', u_anim(i,6));
set(tor_1,'XData', u_anim(1:i,1),'YData', u_anim(1:i,2));
set(tor_2,'XData', u_anim(1:i,3),'YData', u_anim(1:i,4));
set(tor_3,'XData', u_anim(1:i,5),'YData', u_anim(1:i,6));
drawnow;
% pause(0.001);
end
Are you a dark mode enthusiast or are you curious about how it’s shaping MATLAB graphics? Check out the latest article in the MATLAB Graphics and App Building blog.
🔹 User Insights: find out how user surveys influenced the development of graphics themes
🔹 Learn three ways to switch between light and dark themes for figures
🔹 Understand how custom and default colors behave across themes
🔹 Download a handy cheat sheet for working with themes in your graphics and apps.
Similar to what has happened with the wishlist threads (#1 #2 #3 #4 #5), the "what frustrates you about MATLAB" thread has become very large. This makes navigation difficult and increases page load times.
So here is the follow-up page.
What should you post where?
Next Gen threads (#1): features that would break compatibility with previous versions, but would be nice to have
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)
I'm beginning this MATLAB-based numerical methods class, and as I was thinking back to my previous MATLAB/Simulink classes, I definitely remember some projects more fondly than others. One of my most memorable was where I had to use MATLAB to analyze electrocardiogram (ECG) peaks. What about you guys? What are some of the best (or worst 🤭) MATLAB projects or assignments you've been given in the past?
The new figure toolstrip in R2025a was designed from multiple feedback cycles with MATLAB users. See the latest article in the Graphics and App Building blog to see the evolution of the figure toolbar from 1996-2025, learn how user feedback shaped the new toolstrip, and check out the new code-generation feature that makes interactive data exporation reproducible.

For the last day or two, I've been getting "upstream" and other various errors on Answers. Seems to come and go. Anyone else having similar issues?
I rarely use MATLAB.
10%
use MATLAB almost every day.
55%
use MATLAB once every 2-3 days.
10%
only use when specific task require
25%
20 votos
Acerca de General
Discuss a wide range of MATLAB topics and share your thoughts and opinions with other community members.
This is the channel to post to if your topic doesn't fit any other channel contexts.
This is the channel to post to if your topic doesn't fit any other channel contexts.

Community Guidelines MATLAB FAQs