Canaux de discussion
Bienvenue, prenez place !
Discussions est votre espace pour apprendre à connaître vos pairs, relever ensemble de plus grands défis et vous amuser en chemin.
- Vous souhaitez voir les dernières mises à jour ? Suivez les Highlights !
- Vous recherchez des techniques pour améliorer vos compétences MATLAB ou Simulink ? Tips & Tricks est juste pour vous !
- Vous souhaitez partager la blague mathématique, le jeu de mots ou le mème parfait ? Ne cherchez pas plus loin que l՚espace Fun !
- Vous pensez qu՚il manque un canal de discussion ? Dites-nous en plus dans Ideas
Discussions mises à jour
I often see the need of argument validation for which the arguments depend on each other.
function result = myFcn(points, attributes, queryIdx)
% INPUT
% points: [Nx3]
% attributes: [Nx1]
% queryIdx: [Mx1]
%
% OUTPUT
% result: [Mx1]
end
points and attributes depend in size, queryIdx and result as well. The current arguments/end block does not allow to formulate such constraints. The best you can do currently is
function result = myFcn(points, attributes, queryIdx)
arguments(Input)
points (:,3)
attributes (:,1)
queryIdx (:,1)
end
arguments(Output)
result (:,1)
end
assert(height(points) == height(attributes), "Argument validation failed")
...
assert(height(queryIdx) == height(result), "Argument validation failed")
end
Reading just the header without additional comments is unclear for a developer and prone to misunderstanding.
What do you think of the following language extension proposal?
function result = myFcn(points, attributes, queryIdx)
arguments(Input)
points (N,3)
attributes (N,1)
queryIdx (M,1)
end
arguments(Output)
result (M,1)
end
end
The intention is clear for the reader at first sight and gives you guarantees about input/output parameters (in contrast to simple comments). Validating the parameter "points" sets the (temporary) variable N, which can be reused in further argument validations. To be discussed if N and M are valid just within the arguments block or also in the whole function.
What is your opinion on such a language improvement?



Annular, sector, triangular, and cluster heatmaps can all be produced by this tool:https://www.mathworks.com/matlabcentral/fileexchange/125520-special-heatmap
Demo: Group Sep with non-square matrix
Data = rand(3, 12);
SHM = SHeatmap(Data, 'Format','sq');
SHM.RowName = {'Off-peak', 'Peak', 'Regular'};
SHM.ColName = {'Beijing', 'Shanghai', 'Guangzhou', 'Shenzhen'};
SHM.ColGroup = [1,1,1,1, 2,2,2,2, 3,3,3,3];
SHM.draw().setFrame()

Demo: Merge two triangle heatmaps
% Made up some data casually (随便捏造了点数据)
X = randn(20,15) + [(linspace(-1,2.5,20)').*ones(1, 6), (linspace(.5,-.7,20)').*ones(1, 5), (linspace(.9,-.2,20)').*ones(1, 4)];
% Get the correlation matrix (求相关系数矩阵)
Data = corr(X);
figure()
SHM_m1 = SHeatmap(Data, 'Format','sq').draw().setType('tril');
SHM_m1.setColLabel('Visible','off').setText()
SHM_m2 = SHeatmap(Data, 'Format','hex').draw().setType('triu0');
SHM_m2.setRowLabel('Visible','off').setColLabel('Visible','on') % Show the hidden Var-1 label (显示隐藏的 Var-1 标签)

Demo: Circular heatmap with Group Block and GroupSep
% Circular heatmap is currently supported only for
% SHeatmap with 'sq' Format and 'full' Type.
rng(1)
Data = randn(100, 5);
rowName = compose('row-%d', 1:100);
colName = compose('col-%d', 1:5);
rowGroup = [ones(1, 25), 2.*ones(1, 15), 3.*ones(1, 20), 4.*ones(1, 20), 5.*ones(1, 20)];
rowColor = [187,207,232; 222,236,247; 253,253,253; 251,225,216; 231,184,192]./255;
rgnames = {'Group-R1','Group-R2','Group-R3','Group-R4','Group-R5'};
% create figure (图窗创建)
fig = figure('Units','normalized', 'Position',[.1,.05,.5,.72]);
ax = axes('Parent',fig, 'Position',[.1,.1,.75,.75]);
% Draw group block (绘制分组方块)
SCB_L = SClusterBlock(ax, rowGroup, 'Orientation','left', 'ColorList',rowColor, 'Group',rowGroup, 'GroupSep',2.5);
SCB_L.draw(); SCB_L.setXYTLim('XLim',[1.65,1.95], 'YLim',[0, 1], 'TLim',[-3*pi/2, pi/3]);
% Draw circular heatmap (绘制环形热图)
SHM = SHeatmap(ax, Data, 'Format','sq', 'RowGroup',rowGroup, 'GroupSep',2.5);
SHM.TickLength = .3;
SHM.draw();
SHM.setRowName(rowName)
SHM.setColName(colName)
SHM.setRowLabelLocation('right')
SHM.setColLabelLocation('top')
% YLim(1) -> TLim(1), YLim(2) -> TLim(2)
SHM.setXYTLim('XLim',[2, 3], 'YLim',[0, 1], 'TLim',[-3*pi/2, pi/3]);
SHM.Colorbar.Position(1) = SHM.Colorbar.Position(1) + .1;
gHdl = text(ax, SCB_L.X, SCB_L.Y, rgnames, 'FontSize',14, 'FontName','Times New Roman');
setTextPerpRadial(gHdl)
colormap(slanCM(97, 32))

More than 50 examples are incorporated into this tool:

AI writes all my code now
17%
Multiple times a day
24%
A few times a week
18%
A few times a month
7%
Only for suggestions
22%
It is not allowed for my work
12%
363 votes
Absolutely!
65%
Probably
8%
Sometimes yes, sometimes no
8%
Unlikely
15%
Never!
4%
26 votes
<80 characters
14%
80 characters
25%
100 characters
22%
120 characters
16%
>120 characters
15%
something else (comment below)
9%
198 votes
Hello everyone,
Today, we have a wide range of models available for problem-solving, education, and agentic coding. Picking a model for a task itself is a skill worth learning and exploring. We have a bouquet of closed models from Anthropic, OpenAI, Grok (Cursor), Mistral, and Gemini, as well as open-source models like Kimi and Gemma.
I am wondering whether, as a MathWorks community, we can come up with some benchmarks tailored for MATLAB + AI models by choosing and compiling tasks like plotting (graphing), some matrix problems, signal processing tasks, control system problems and other engineering problems, and then test AI model with Matlab-MCP server and document performance.
Reaching a consensus would really help us choose a certain model for certain tasks. That way, we can save API tokens, be smart with our choices and as a community, we can learn and help by sharing our experiences. I would love to hear your thoughts and see what this conversation could lead to.
@Hans Scharler do you have any initial thoughts to share with us?

Uniform spacing and the problem of round-off error
The vector [3 4 5 6 7 8 9] is uniformly spaced with a step size of 1. So is [3 2 1 0 -1 -2] but with a step size of -1.
The vector [1 2 4 8] is not uniformly spaced.
A vector v with uniform spacing has the same finite interval or step size between consecutive elements of the vector. But sometimes round-off error poses a problem in calculating uniformity.
Take, for example, the vector produced by
format shortg
v = linspace(1,9,7)
v = 1x7
1 2.3333 3.6667 5 6.3333 7.6667 9
Linspace produces linearly spaced vectors but the intervals between elements of v, computed by diff(v), are not identical.
dv = diff(v)
dv = 1x6
1.3333 1.3333 1.3333 1.3333 1.3333 1.3333
dv == dv(1)
ans = 1×6 logical array
1 0 0 1 0 1
diff(dv)
ans = 1x5
4.4409e-16 0 -4.4409e-16 8.8818e-16 -8.8818e-16
Some extra steps are therefore necessary to set a tolerance that ignores error introduced by floating point arithmetic.
New in R2022b: isuniform
Determining uniformity of a vector became a whole lot easier in MATLAB R2022b with the new isuniform function.
isuniform returns a logical scalar indicating whether vector v is uniformly spaced within a round-off tolerance and returns the step size (or NaN if v is not uniform).
Let's look at the results for our vector v,
[tf,step] = isuniform(v)
tf = logical
1
step =
1.3333
How about non-uniformly spaced vector?
[tf,step] = isuniform(logspace(1,5,4))
tf = logical
0
step =
NaN
Give it a shot in MATLAB R2022b
- What happens when all elements of v are equal?
- Can you produce a vector with uniform spacing without using colons or linspace?
- What additional steps would be needed to use isuniform with circular data?
References
- isuniform - documentation
- Floating point numbers - documentation
- Floating point numbers - Cleve's Corner (blog)
This article is attached as a live script.
How does MATLAB ThingSpeak Work ?
What did you guys do? It's impossible to edit figures on the fly now. Even simple things like removing data series and then removing them from the legend have become impossible without meddling with code. It used to be you could do little touch ups and even copy series from one figure to the next in the most expeditious and simple way, that to me was a big plus of using Matlab over python. Now this is so backwards and unintuitive, what were you guys thinking?
What is it?
SimFunction allows you to perform multiple simulations in a single line of code by providing an interface to execute SimBiology® models like a regular MATLAB function.
Consider the following similarity: If you want to calculate the value of the sine function at multiple times defined in the variable t, you use the following syntax:
y = sin(t)
If mymodel represents a SimFunction, you can simulate your model with multiple parameter sets using the following syntax:
simulationData = mymodel(parameterValues, stopTime, dose)
What is it good for?
Multiple simulations
Because it allows you to perform multiple simulations in a single line of code by providing a matrix of parameter values or variants or a cell array of dosing tables, it is particularly suited for
- parameter and dose scans
- Monte Carlo simulations
- customized analyses that require multiple model simulations such as a customized optimization
Performance
SimFunctions are optimized for performance as they are automatically accelerated at the first function execution, which converts the model into compiled C code. Those simulations can be distributed to multiple cores or to a cluster and run in parallel if Parallel Computing Toolbox™ is available thanks to its built-in parallelization or within a parfor loop.
Simulation deployment
Since SimFunction objects cannot be changed once created, they can be shared with others without the risk of altering the model inadvertently.
Also, you can use SimFunctions to integrate a SimBiology model into a customized MATLAB App and compile it as a web app or standalone executable to share with anyone without the need of a MATLAB license.
How does it work?
- which parameters it should take as inputs
- which targets will be dosed
- which model quantities it should return
- which sensitivities it should return if any
Have a look at the following example from the SimBiology documentation for an executable script to help you get started: Perform a Parameter Scan.
I've left Matlab Answers in spring 2023. At this time the forum was full of interesting programming questions, e.g about optimizing code. A bunch of experienced Matlab users have discussed diefferent approachs and compared them. Some questions have concerned beginner problems and home work solutions, others belonged to professionally used tools for scientific work
Every week some new tools for dailiy use have been posted in the FileExchange.
Today, 3 years later, the traffic is much lower and questions concern the correct usage of Matlab commands usually. Submissions in the FileExchange are very specific and rarely useful for general programming jobs.
What has happend?
Giving All Your Claudes the Keys to Everything

Introduction
This started as a plumbing problem. I wanted to move files between Claude’s cloud container and my Mac faster than base64 encoding allows. What I ended up building was something more interesting: a way for every Claude – Desktop, web browser, iPhone – to control my entire computing environment with natural language. MATLAB, Keynote, LaTeX, Chrome, Safari, my file system, text-to-speech. All of it, from any device, through a 200-line Python server and a free tunnel.
It isn’t quite the ideal universal remote. Web and iPhone Claude do not yet have the agentic Playwright-based web automation capabilities available to Claude desktop via MCP. A possible solution may be explored in a later post.
Background information
The background here is a series of experiments I’ve been running on giving AI desktop apps direct access to local tools. See How to set up and use AI Desktop Apps with MATLAB and MCP servers which covers the initial MCP setup, A universal agentic AI for your laptop and beyond which describes what Desktop Claude can do once you give it the keys, and Web automation with Claude, MATLAB, Chromium, and Playwright which describes a supercharged browser assistant. This post is about giving such keys to remote Claude interfaces.
Through the Model Context Protocol (MCP), Claude Desktop on my Mac can run MATLAB code, read and write files, execute shell commands, control applications via AppleScript, automate browsers with Playwright, control iPhone apps, and take screenshots. These powers have been limited to the desktop Claude app – the one running on the machine with the MCP servers. My iPhone Claude app and a Claude chat launched in a browser interface each have a Linux container somewhere in Anthropic’s cloud. The container can reach the public internet. Until now, my Mac sat behind a home router with no public IP.
An HTTP server MCP replacement
A solution is a small HTTP server on the Mac. Use ngrok (free tier) to give the Mac a public URL. Then anything with internet access – including any Claude’s cloud container – can reach the Mac via curl.
iPhone/Web Claude -> bash_tool: curl https://public-url/endpoint
-> Internet -> ngrok tunnel -> Mac localhost:8765
-> Python command server -> MATLAB / AppleScript / filesystem
The server is about 200 lines of Python using only the standard library. Two files, one terminal command to start. ngrok provides HTTPS and HTTP Basic Auth with a single command-line flag.
The complete implementation consists of three files:
claude_command_server.py (~200 lines): A Python HTTP server using http.server from the standard library. It implements BaseHTTPRequestHandler with do_GET and do_POST methods dispatching to endpoint handlers. Shell commands are executed via subprocess.run with timeout protection. File paths are validated against allowed roots using os.path.realpath to prevent directory traversal attacks.
start_claude_server.sh (~20 lines): A Bash script that starts the Python server as a background process, then starts ngrok in the foreground. A trap handler ensures both processes are killed on Ctrl+C.
iphone_matlab_watcher.m (~60 lines): MATLAB timer function that polls for command files every second.
The server exposes six GET and six POST endpoints. The GET endpoints thus far handle retrieval: /ping for health checks, /list to enumerate files in a transfer directory, /files/<n> to download a file from that directory, /read/<path> to read any file under allowed directories, and / which returns the endpoint listing itself. The POST endpoints handle execution and writing: /shell runs an allowlisted shell command, /osascript runs AppleScript, /matlab evaluates MATLAB code through a file-watcher mechanism, /screenshot captures the screen and returns a compressed JPEG, /write writes content to a file, and /upload/<n> accepts binary uploads.
File access is sandboxed by endpoint. The /read/ endpoint restricts reads to ~/Documents, ~/Downloads, and ~/Desktop and their subfolders. The /write and /upload endpoints restrict writes to ~/Documents/MATLAB and ~/Downloads. Path traversal is validated – .. sequences are rejected.
The /shell endpoint restricts commands to an explicit allowlist: open, ls, cat, head, tail, cp, mv, mkdir, touch, find, grep, wc, file, date, which, ps, screencapture, sips, convert, zip, unzip, pbcopy, pbpaste, say, mdfind, and curl. No rm, no sudo, no arbitrary execution. Content creation goes through /write.
Two endpoints have no path restrictions: /osascript and /matlab. The /osascript endpoint passes its payload to macOS’s osascript command, which executes AppleScript – Apple’s scripting language for controlling applications via inter-process Apple Events. An AppleScript can open, close, or manipulate any application, read or write any file the user account can access, and execute arbitrary shell commands via “do shell script”. The /matlab endpoint evaluates arbitrary MATLAB code in a persistent session. Both are as powerful as the user account itself. This is deliberate – these are the endpoints that make the server useful for controlling applications. The security boundary is authentication at the tunnel, not restriction at the endpoint.
The MATLAB Workaround
MATLAB on macOS doesn’t expose an AppleScript interface, and the MCP MATLAB tool uses a stdio connection available only from Desktop. So how does iPhone Claude run MATLAB?
An answer is a file-based polling mechanism. A MATLAB timer function checks a designated folder every second for new command files. The remote Claude writes a .m file via the server, MATLAB executes it, writes output to a text file, and sets a completion flag. The round trip is about 2.5 seconds including up to 1 second of polling latency. (This could be reduced by shortening the polling interval or replacing it with Java’s WatchService for near-instant file detection.)
This method provides full MATLAB access from a phone or web Claude, with your local file system available, under AI control. MATLAB Mobile and MATLAB Online do not offer agentic AI access.
Alternate approaches
I’ve used Tailscale Funnel as an alternative tunnel to manually control my MacBook from iPhone but you can’t install Tailscale inside Anthropic’s container. An alternative approach would replace both the local MCP servers and the command server with a single remote MCP server running on the Mac, exposed via ngrok and registered as a custom connector in claude.ai. This would give all three Claude interfaces native MCP tool access including Playwright or Puppeteer with comparable latency but I’ve not tried this.
Security
Exposing a command server to the internet raises questions. The security model has several layers. ngrok handles authentication – every request needs a valid password. Shell commands are restricted to an allowlist (ls, cat, cp, screencapture – no rm, no arbitrary execution). File operations are sandboxed to specific directory trees with path traversal validation. The server binds to localhost, unreachable without the tunnel. And you only run it when you need it.
The AppleScript and MATLAB endpoints are relatively unrestricted in my setup, giving Claude Desktop significant capabilities via MCP. Extending them through an authenticated tunnel is a trust decision.
Initial test results
I ran an identical three-step benchmark from each Claude interface: get a Mac timestamp via AppleScript, compute eigenvalues of a 10x10 magic square in MATLAB, and capture a screenshot. Same Mac, same server, same operations.
| Step | Desktop (MCP) | Web Claude | iPhone Claude |
|------|:------------:|:----------:|:-------------:|
| AppleScript timestamp | ~5ms | 626ms | 623ms |
| MATLAB eig(magic(10)) | 108ms | 833ms | 1,451ms |
| Screenshot capture | ~200ms | 1,172ms | 980ms |
| **Total** | **~313ms** | **2,663ms** | **3,078ms** |
The network overhead is consistent: web and iPhone both add about 620ms per call (the ngrok round trip through residential internet). Desktop MCP has no network overhead at all. The MATLAB variance between web (833ms) and iPhone (1,451ms) is mostly the file-watcher polling jitter – up to a second of random latency depending on where in the polling cycle the command arrives.
All three Claudes got the correct eigenvalues. All three controlled the Mac. The slowest total was 3 seconds for three separate operations from a phone. Desktop is 10x faster, but for “I’m on my phone and need to run something” – 3 seconds is fine.
Other tests

MATLAB: Computations (determinants, eigenvalues), 3D figure generation, image compression. The complete pipeline – compute on Mac, transfer figure to cloud, process with Python, send back – runs in under 5 seconds. This was previously impossible; there was no reasonable mechanism to move a binary file from the container to the Mac.
Keynote: Built multi-slide presentations via AppleScript, screenshotted the results.
TeXShop: Wrote a .tex file containing ten fundamental physics equations (Maxwell through the path integral), opened it in TeXShop, typeset via AppleScript, captured the rendered PDF. Publication-quality typesetting from a phone. I don’t know who needs this at 11 PM on a Sunday, but apparently I do.
Safari: Launched URLs on the Mac from 2,000 miles away. Or 6 feet. The internet doesn’t care.
Finder: Directory listings, file operations, the usual filesystem work.
Text-to-speech: Mac spoke “Hello from iPhone” and “Web Claude is alive” on command. Silly but satisfying proof of concept.
File Transfer: The Original Problem, Solved
Remember, this started because I wanted faster file transfers for desktop Claude. Compare:
| Method | 1 MB file | 5 MB file | Limit |
|--------|-----------|-----------|-------|
| Old (base64 in context) | painful | impossible | ~5 KB |
| Command server upload | 455ms | ~3.6s | tested to 5 MB+ |
| Command server download | 1,404ms | ~7s | tested to 5 MB+ |
The improvement is the difference between “doesn’t work” and “works in seconds.”
Cross-Device Memory
A nice bonus: iPhone and web Claudes can search Desktop conversations using the same memory tools. Context established in a Desktop session – including the server password – can be retrieved from a phone conversation. You do have to ask explicitly (“search my past conversations for the command server”) or insert information into the persistent context using settings rather than assuming Claude will look on its own.
Web Claudes
The most surprising result was web Claude. I expected it to work – same container infrastructure, same bash_tool, same curl. But “expected to work” and “just worked, first try, no special setup” are different things. I opened claude.ai in a browser, gave it the server URL and password, and it immediately ran MATLAB, took screenshots, and made my Mac speak. No configuration, no troubleshooting, no “the endpoint format is wrong” iterations. If you’re logged into claude.ai and the server is running, you have full Mac access from any browser on any device.
What This Means
MCP gave Desktop Claude the keys to my Mac. A 200-line server and a free tunnel duplicated those keys for every other Claude I use. Three interfaces, one Mac, all the same applications, all controlled in natural language.
Additional information
An appendix gives Claude’s detailed description of communications. Codes and instructions are available at the MATLAB File Exchange: Giving All Your Claudes the Keys to Everything.
Acknowledgments and disclaimer
The problem of file transfer was identified by the author. Claude suggested and implemented the method, and the author suggested the generalization to accommodate remote Claudes. This submission was created with Claude assistance. The author has no financial interest in Anthropic or MathWorks.
—————
Appendix: Architecture Comparison
Path A: Desktop Claude with a Local MCP Server
When you type a message in the Desktop Claude app, the Electron app sends it to Anthropic’s API over HTTPS. The LLM processes the message and decides it needs a tool – say, browser_navigate from Playwright. It returns a tool_use block with the tool name and arguments. That block comes back to the Desktop app over the same HTTPS connection.
Here is where the local MCP path kicks in. At startup, the Desktop app read claude_desktop_config.json, found each MCP server entry, and spawned it as a child process on your Mac. It performed a JSON-RPC initialize handshake with each one, then called tools/list to get the tool catalog – names, descriptions, parameter schemas. All those tools were merged and sent to Anthropic with your message, so the LLM knows what’s available.
When the tool_use block arrives, the Desktop app looks up which child process owns that tool and writes a JSON-RPC message to that process’s stdin. The MCP server (Playwright, MATLAB, whatever) reads the request, does the work locally, and writes the result back to stdout as JSON-RPC. The Desktop app reads the result, sends it back to Anthropic’s API, the LLM generates the final text response, and you see it.
The Desktop app is really just a process manager and JSON-RPC router. The config file is a registry of servers to spawn. You can plug in as many as you want – each is an independent child process advertising its own tools. The Desktop app doesn’t care what they do internally. The MCP execution itself adds almost no latency because it’s entirely local, process-to-process on your Mac. The time you perceive is dominated by the two HTTPS round-trips to Anthropic, which all three Claude interfaces share equally.
Path B: iPhone Claude with the Command Server
When you type a message in the Claude iOS app, the app sends it to Anthropic’s API over HTTPS, same as Desktop. The LLM processes the message. It sees bash_tool in its available tools – provided by Anthropic’s container infrastructure, not by any MCP server. It decides it needs to run a curl command and returns a tool_use block for bash_tool.
Here, the path diverges completely from Desktop. There is no iPhone app involvement in tool execution. Anthropic routes the tool_use to a Linux container running in Anthropic’s cloud, assigned to your conversation. This container is the “computer” that iPhone Claude has access to. The container runs the curl command – a real Linux process in Anthropic’s data center.
The curl request goes out over the internet to ngrok’s servers. ngrok forwards it through its persistent tunnel to the claude_command_server.py process running on localhost on your Mac. The command server authenticates the request (basic auth), then executes the requested operation – in this case, running an AppleScript via subprocess.run(['osascript', ...]). macOS receives the Apple Events, launches the target application, and does the work.
The result flows back the same way: osascript returns output to the command server, which packages it as JSON and sends the HTTP response back through the ngrok tunnel, through ngrok’s servers, back to the container’s curl process. bash_tool captures the output. The container sends the tool result back to Anthropic’s API. The LLM generates the text response, and the iPhone app displays it.
The iPhone app is a thin chat client. It never touches tool execution – it only sends and receives chat messages. The container does the curl work, and the command server bridges from Anthropic’s cloud to your Mac. The LLM has to know to use curl with the right URL, credentials, and JSON format. There is no tool discovery, no protocol handshake, no automatic routing. The knowledge of how to reach your Mac is carried entirely in the LLM’s context.
—————
Duncan Carlsmith, Department of Physics, University of Wisconsin-Madison. duncan.carlsmith@wisc.edu
Hi everyone,
Simulations have a way of outgrowing the machine they run on (at least mine do). Bigger sweeps, longer regression suites, more data to pull in. At some point your workstation just isn't beefy enough!
I've just published a post on running larger MATLAB and Simulink simulations in the cloud (e.g. AWS): more compute when we need it, without changing how we work day to day.
The example is from automotive, but the same applies to aerospace, robotics, and beyond.
If you want to read more, here's the link: https://blogs.mathworks.com/engineering/2026/07/14/on-scaling-model-based-design-into-the-cloud/
How are others handling scaling for simulation? what's working for you?
Cheers,
George

All figures presented in this Discussion were generated using MATLAB.


I developed two functions: one for plotting chord diagrams without self-loops, and the other for plotting chord diagrams with self-loops.
chordChart : basic usage
plotting chord diagrams without self-loops : https://www.mathworks.com/matlabcentral/fileexchange/116550-chordchart-chord-diagram
dataMat = [2 0 1 2 5 1 2;
3 5 1 4 2 0 1;
4 0 5 5 2 4 3];
colName = {'B1','G2','G3','G4','G5','G6','G7'};
rowName = {'S1','S2','S3'};
% Create and render chord diagram object (创建弦图对象并渲染)
CC = chordChart(dataMat, 'RowName',rowName, 'ColName',colName, 'Arrow','on');
CC.LinearMinorTick = 'on';
CC.draw();
% Set Font for labels and show ticks (调整字体并显示刻度)
CC.setFont('FontSize',17, 'FontName','Cambria')
CC.tickState('on')
CC.tickLabelState('on')

biChordChart : basic usage
plotting chord diagrams with self-loops : https://www.mathworks.com/matlabcentral/fileexchange/121043-bichordchart-bidirectional-chord-diagram
dataMat = randi([0,8], [5,5]);
nameList = {'AAA','BBB','CCC','DDD','EEE'};
% Create bichord chart object and draw (创建并绘制双向弦图对象)
BCC = biChordChart(dataMat, 'Arrow','on', 'Label',nameList);
BCC = BCC.draw();
% Show ticks and tick labels (添加刻度)
BCC.tickState('on')
BCC.tickLabelState('on')
% Set font properties (修改字体,字号及颜色)
BCC.setFont('FontName','Cambria','FontSize',17)

The two File Exchange submissions each provide more than a dozen basic examples. In addition, the GitHub repository listed below provides nearly 40 elaborate customized demonstration cases.













MATLAB Editor (built-in editor)
74%
VS Code (Visual Studio Code)
18%
Jupyter Notebook / MATLAB Kernel
2%
PyCharm (via plugins or external )
2%
Sublime Text / Atom
1%
Others (please specify in commets)
2%
960 votes
Looking for an on-campus job next semester? We’re hiring MATLAB Student Ambassadors to host fun events, share MATLAB resources on social media, and connect with your student community.
Learn more here: https://www.mathworks.com/academia/students/student-ambassadors.html

How does everyone use MatLab right now? I can't think of any ideas what i can use this software for!
Hi everyone
It is my pleasure to be able to report on a project that several teams at MathWorks have been working on for some time now. A new object management system that promises to make object oriented code in MATLAB a lot faster.
The new system is available as a limited beta in the pre-release of MATLAB 2026b. It is not turned on by default. If you are developing OOP code, we'd love you to try it out. Most of the time, no code changes will be necessary but there are a small number of well-defined case where you will need to update your code.
The team are currently looking for MATLAB developers to work with who would like to try this out.
More details, including how to join the beta, are available in the following blog post https://blogs.mathworks.com/matlab/2026/07/14/objects-are-about-to-get-much-faster-in-matlab/
Best wishes,
Mike
Did you know that function double with string vector input significantly outperforms str2double with the same input:
x = rand(1,50000);
t = string(x);
tic; str2double(t); toc
tic; I1 = str2double(t); toc
tic; I2 = double(t); toc
isequal(I1,I2)
Recently I needed to parse numbers from text. I automatically tried to use str2double. However, profiling revealed that str2double was the main bottleneck in my code. Than I realized that there is a new note (since R2024a) in the documentation of str2double:
"Calling string and then double is recommended over str2double because it provides greater flexibility and allows vectorization. For additional information, see Alternative Functionality."
I have been a loyal MATLAB user for 25 years, starting from my university days. While many of my peers migrated to Python, I stayed for the stability, compatibility, and clean environment. However, I am finding the 2025 version exceptionally laggy. Despite running it on an $10k high-end machine, simple tasks like viewing variables and plotting take up to 60 seconds - actions that were near instantaneous in the 2020 version. I want to stay continue with MATLAB, but this performance gap is a major hurdle and irritation. I hope these optimization issues can be addressed quickly.
À propos de Discussions
Discussions is a user-focused forum for the conversations that happen outside of any particular product or project.
Get to know your peers while sharing all the tricks you've learned, ideas you've had, or even your latest vacation photos. Discussions is where MATLAB users connect!
Get to know your peers while sharing all the tricks you've learned, ideas you've had, or even your latest vacation photos. Discussions is where MATLAB users connect!
Plus d՚espaces communautaires
MATLAB Answers
Posez ou répondez aux questions concernant MATLAB et Simulink !
File Exchange
Téléchargez un code soumis par un utilisateur ou proposez votre contribution !
Cody
Résolvez des groupes de problèmes, découvrez MATLAB et gagnez des badges !
Blogs
Découvrez le point de vue des initiés sur MATLAB et Simulink !
AI Chat Playground
Utilisez l’IA pour générer un draft initial de votre code MATLAB et répondre aux questions !



