Main Content

Results for

Jan
Jan
Last activity about 4 hours ago

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?
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.
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
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
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.
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.
Analyst
Analyst
Last activity on 16 Jul 2026 at 11:52

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
ProdSec
ProdSec
Last activity on 6 Jul 2026 at 11:43

How does MATLAB ThingSpeak Work ?
Ralf Axel
Ralf Axel
Last activity on 8 Jul 2026 at 4:47

Hallo zusammen, Ich habe einen Frage zu meinen Programm. Dies will einfach nicht laufen und ich finde keinen Fehler mehr. Ich habe mein Programm bei Simulink geschriebenen den Code bei Maltab Function. Das Board ist ein Adruino Uni Board. Ein Ultrasonic Sensor soll die Füllstände ich Wäschekörben messen. Dabei wird unter voll oder halbvoll entschieden. Anschließend wird ein Motor angesprochen, der entweder 15 oder 30 Sekunden laufen soll. Überwacht wird der Motor von einem Thermistor (den habe ich hier PT100 genannt) und einen Vibrationsschalter. Dazu soll der Vibrationsschalter über einen Resetknopf zurückgesetzt werden. Ich hoffe ihr könnt mir weiterhelfen. Vielen Dank:) if true % code end
n= input('Escolhe um número inteiro postivo. ')
primo=true;
i=2;
while i<n
if mod(n,i)==0;
primo=false;
end
i= i+1;
end
if primo && n>1;
disp('É primo')
else
disp('Não é primo')
end
anterior= n-1;
while true
primo=true;
i=2;
while i< anterior
if mod(anterior,i)==0;
primo= false;
end
i= i+1;
end
if primo && anterior>1;
end
anterior= anterior-1;
end
disp(anterior)
seguinte= n+1;
while true;
primo= true;
i=2;
while i<seguinte;
if mod(seguinte,i)==0;
primo=false;
end
i=i+1;
end
if primo && seguinte>1;
end
seguinte= seguinte+1;
end
disp(seguinte)
Any ideas? It is in portuguese if you intend to translate it.
This is a brief introduction and recommendation of a Sankey diagram plotting tool:
Basic usage - links
links={'a1','A',1.2;'a2','A',1;'a1','B',.6;'a3','A',1; 'a3','C',0.5;
'b1','B',.4; 'b2','B',1;'b3','B',1; 'c1','C',1;
'c2','C',1; 'c3','C',1;'A','AA',2; 'A','BB',1.2;
'B','BB',1.5; 'B','AA',1.5; 'C','BB',2.3; 'C','AA',1.2};
% 创建桑基图对象(Create a Sankey diagram object)
SK=SSankey(links(:,1),links(:,2),links(:,3));
% 开始绘图(Start drawing)
SK.draw()
Basic usage - adjMat
% Define inter-layer adjacency matrices
% 定义层间邻接矩阵
A12 = [1,2,1; 1,2,3; 2,0,1];
A23 = [1,4; 2,1; 0,3];
A34 = [1,5; 2,3];
% Assemble global block matrix (main diagonal = zero, super-diagonal = A12, A23, A34)
% 组装全局分块矩阵(主对角线为零,上对角线为 A12, A23, A34)
adjMat = mergeAdjMat({A12, A23, A34});
SK = SSankey([],[],[], 'AdjMat',adjMat);
SK.draw()
Further usage examples can be found in the demos included in the compressed package:
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
ZhiJun
ZhiJun
Last activity on 28 Jun 2026 at 0:20

Hello everyone,
Does anyone know of a reliable tool (or workflow) that can automatically convert MATLAB code to C++ code? I am aware of MATLAB Coder, but I would like to know if there are any third‑party tools or scripts that can perform a similar translation, especially for numerical/computational code.
Any suggestions or experiences would be greatly appreciated. Thank you!
I follow a lot of astronomical/astrophysical missions and notice they have now gotten massive in size, scope, and data. Petabyte datasets are now commonplace. Some are now moving essentially to private clouds where researchers create accounts and use primarily FOSS tools to process data. Some examples are the Vera Rubin Observatory's Rubin Science Platform and ESA's Datalabs. Jupyter has entrenched itself deeply despite its many shortcomings. I can't create accounts on any of these platforms but I am guessing that getting support for license-servers and other paraphernalia associated with closed-source software won't be easy.
It makes sense at some level when datasets get so big they can't be practically served to a researcher's machine. But, I do wonder what this public data in private clouds means for MATLAB and similar paid software. All the projects say that FOSS encourages reproducibility but I've been burned more than once in my working life by randomly phased Python package updates and abandoned projects.
I'm retired now and don't have a dog in the fight. My MATLAB home license is just for self-improvement. I was just curious whether Mathworks and similar providers will have to give up on the basic science community and focus on applied, mission-critical areas where "some guy on Github" is not sufficient traceability.
Hi everyone,
I'm interested in learning how developers compare code, configuration files, JSON data, or text changes when working outside of version control systems.
Common scenarios include:
- Comparing two versions of a script
- Reviewing generated output
- Checking configuration changes
- Comparing API responses or JSON files
- Reviewing documentation updates
I've used IDE comparison features and online diff tools. One browser-based tool I've found useful for quick comparisons is Text Differ:
I'm curious what workflows or tools other community members prefer. Do you rely on built-in editor features, version control diffs, or dedicated comparison tools?
Looking forward to hearing your experiences.
I've been confused trying to write (or have an AI write) the .m (Live) text format from scratch for various reasons using .mlx format exported with the IDE as .m (old) and .m (LIve). Of course, one problem is the .m and .m (Live) files have the same name,causing confusion and requiring renaming, but repeatedly, after sussing out and following all conventions for headings and latex etc in .m (LIve), my .m (Live) files would not open as .mlx in the IDE. I think I've found the answer by trial and error and comparison and don't know it is documented. Add at the end
%[appendix]{"version":"1.0"} %--- %[metadata:view] % data: {"layout":"inline"} %---
This seems to trigger the IDE to recognize this is a .m (Live). Woohoo! This is a LOT easier than writing .mlx zip packages from scratch.
Have there been some changes made to the ThinkSpeak graphs? I am unable to change the number of days displayed, nor the number of data points to display. I did have them display 5 days, but now they are showing 14 days even though the setting is 5. I tried logging out and back in, but to no avail. Thanks.
var = yes;
86%
var=no;
6%
I don't mind either way
8%
765 votes
<80 characters
14%
80 characters
25%
100 characters
22%
120 characters
16%
>120 characters
15%
something else (comment below)
9%
198 votes
camelCase (variableName)
39%
PascalCase (VariableName)
12%
no capitalization (variablename)
4%
snake_case (variable_name)
27%
It varies for me
18%
802 votes