主要内容

搜索


I'm getting this annoying survey (screenshot below) in the help windows of MATLAB R2024b this morning. It blocks the text I'm actually trying to read, when minimised it pops up again after a few minutes, and persists even after picking an option and completing the SurveyMonkey survey it links to. I don't even know what the OPC UA server so rest assured any of my answers to that survey aren't going to help MathWorks improve their product.
Gregory Vernon
Gregory Vernon
上次活动时间: 大约 14 小时 前

I've long used the Tensor Toolbox from Sandia in order to use tensors in Matlab, but recently found myself wanting to apply it on symbolic arguments, which don't appear supported. Some google-fu'ing resulted in (non-free) Tensorlab and some file-exchange entries of mixed quality. And of course, there's the recent tensorprod, which a) doesn't support symbolics and b) arguments aren't strictly tensors (rather "representations of tensors in a matrix type").
This all got me to thinking that it would be mighty nice to have general / native / comprehensive support for a tensor class in official Matlab - even if it were in a separate toolbox.
Aochen Xiao
Aochen Xiao
上次活动时间: 大约 21 小时 前

It is April 3, 2025 now. Where is the MATLAB 2025a?
Giuseppe
Giuseppe
上次活动时间: 2025-4-2,19:10

ho questo codice matlab, vorrei creare un grafico inerente all'andamento di c1,c2,cm al variare di d1, purtroppo mi da sempre lo stesso errore horzcat, inerente alle dimensioni delle matrici , nonostante le dimensioni siano corrette e uguali
Me: If you have parallel code and you apply this trick that only requires changing one line then it might go faster.
Reddit user: I did and it made my code 3x faster
Not bad for just one line of code!
Which makes me wonder. Could it make your MATLAB program go faster too? If you have some MATLAB code that makes use of parallel constructs like parfor or parfeval then start up your parallel pool like this
parpool("Threads")
before running your program.
The worst that will happen is you get an error message and you'll send us a bug report....or maybe it doesn't speed up much at all....
....or maybe you'll be like the Reddit user and get 3x speed-up for 10 seconds work. It must be worth a try...after all, you're using parallel computing to make your code faster right? May as well go all the way.
In an artificial benchmark I tried, I got 10x speedup! More details in my recent blog post: Parallel computing in MATLAB: Have you tried ThreadPools yet? » The MATLAB Blog - MATLAB & Simulink
Give it a try and let me know how you get on.
Chalachew
Chalachew
上次活动时间: 2025-3-31,12:41

I hope you well receive this messege as well.
I am happy jion for your site.
I start to do project on UAV
kindy could you please send me you tube, documets regarding to quadrotror mathlab simulink?
Please help me
看到知乎有用Origin软件绘制3D瀑布图,觉得挺美观的,突然也想用MATLAB复现一样的图,借助ChatGPT,很容易写出代码,相对Origin软件,无需手动干预调整图像属性,代码控制性强:
%% 清理环境
close all; clear; clc;
%% 模拟时间序列
t = linspace(0,12,200); % 时间从 0 到 12,分 200 个点
% 下面构造一些模拟的"峰状"数据,用于演示
% 你可以根据需要替换成自己的真实数据
rng(0); % 固定随机种子,方便复现
baseIntensity = -20; % 强度基线(z 轴的最低值)
numSamples = 5; % 样本数量
yOffsets = linspace(20,140,numSamples); % 不同样本在 y 轴上的偏移
colors = [ ...
0.8 0.2 0.2; % 红
0.2 0.8 0.2; % 绿
0.2 0.2 0.8; % 蓝
0.9 0.7 0.2; % 金黄
0.6 0.4 0.7]; % 紫
% 构造一些带多个峰的模拟数据
dataMatrix = zeros(numSamples, length(t));
for i = 1:numSamples
% 随机峰参数
peakPositions = randperm(length(t),3); % 三个峰位置
intensities = zeros(size(t));
for pk = 1:3
center = peakPositions(pk);
width = 10 + 10*rand; % 峰宽
height = 100 + 50*rand; % 峰高
% 高斯峰
intensities = intensities + height*exp(-((1:length(t))-center).^2/(2*width^2));
end
% 再加一些小随机扰动
intensities = intensities + 10*randn(size(t));
dataMatrix(i,:) = intensities;
end
%% 开始绘图
figure('Color','w','Position',[100 100 800 600],'Theme','light');
hold on; box on; grid on;
for i = 1:numSamples
% 构造 fill3 的多边形顶点
xPatch = [t, fliplr(t)];
yPatch = [yOffsets(i)*ones(size(t)), fliplr(yOffsets(i)*ones(size(t)))];
zPatch = [dataMatrix(i,:), baseIntensity*ones(size(t))];
% 使用 fill3 填充面积
hFill = fill3(xPatch, yPatch, zPatch, colors(i,:));
set(hFill,'FaceAlpha',0.8,'EdgeColor','none'); % 调整透明度、去除边框
% 在每条曲线尾部标注 Sample i
text(t(end)+0.3, yOffsets(i), dataMatrix(i,end), ...
['Sample ' num2str(i)], 'FontSize',10, ...
'HorizontalAlignment','left','VerticalAlignment','middle');
end
%% 坐标轴与视角设置
xlim([0 12]);
ylim([0 160]);
zlim([-20 350]);
xlabel('Time (sec)','FontWeight','bold');
ylabel('Frequency (Hz)','FontWeight','bold');
zlabel('Intensity','FontWeight','bold');
% 设置刻度(根据需要微调)
set(gca,'XTick',0:2:12, ...
'YTick',0:40:160, ...
'ZTick',-20:40:200);
% 设置视角(az = 水平旋转,el = 垂直旋转)
view([211 21]);
% 让三维坐标轴在后方
set(gca,'Projection','perspective');
% 如果想去掉默认的坐标轴线,也可以尝试
% set(gca,'BoxStyle','full','LineWidth',1.2);
%% 可选:在后方添加一个浅色网格平面 (示例)
% 这个与题图右上方的网格类似
[Xplane,Yplane] = meshgrid([0 12],[0 160]);
Zplane = baseIntensity*ones(size(Xplane)); % 在 Z = -20 处画一个竖直面的框
surf(Xplane, Yplane, Zplane, ...
'FaceColor',[0.95 0.95 0.9], ...
'EdgeColor','k','FaceAlpha',0.3);
%% 进一步美化(可根据需求调整)
title('3D Stacked Plot Example','FontSize',12);
constantplane("x",12,FaceColor=rand(1,3),FaceAlpha=0.5);
constantplane("y",0,FaceColor=rand(1,3),FaceAlpha=0.5);
constantplane("z",-19,FaceColor=rand(1,3),FaceAlpha=0.5);
hold off;
Have fun! Enjoy yourself!
David
David
上次活动时间: 2025-3-29,2:44

We are excited to announce the first edition of the MathWorks AI Challenge. You’re invited to submit innovative solutions to challenges in the field of artificial intelligence. Choose a project from our curated list and submit your solution for a chance to win up to $1,000 (USD). Showcase your creativity and contribute to the advancement of AI technology.
I am pleased to announce the 6th Edition of my book MATLAB Recipes for Earth Sciences with Springer Nature
also in the MathWorks Book Program
It is now almost exactly 20 years since I signed the contract with Springer for the first edition of the book. Since then, the book has grown from 237 to 576 pages, with many new chapters added. I would like to thank my colleagues Norbert Marwan and Robin Gebbers, who have each contributed two sections to Chapters 5, 7 and 9.
And of course, my thanks go to the excellent team at the MathWorks Book Program and the numerous other MathWorks experts who have helped and advised me during the last 30+ years working with MATLAB. And of course, thank you Springer for 20 years of support.
This book introduces methods of data analysis in the earth sciences using MATLAB, such as basic statistics for univariate, bivariate, and multivariate data sets, time series analysis, signal processing, spatial and directional data analysis, and image analysis.
Martin H. Trauth
I am trying to integrate an external C++ function (large package) into a mex function. I have written a cmake file, which generates library for external C++ function and I am using matlab_add_mex to generate the mex-file.
# Find MATLAB
set(Matlab_ROOT_DIR "../mathworks/2023b/bin/")
find_package(Matlab REQUIRED)
# Add a MEX target
matlab_add_mex(
NAME my_mex_function
SRC my_mex_function.cpp
LINK_TO my_library
)
find_package(Matlab REQUIRED) - gives following error:
CMake Error at CMakeLists.txt: (find_package):
By not providing "Findmatlab.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "matlab", but CMake did not find one.
Could not find a package configuration file provided by "matlab" with any of the following names:
matlabConfig.cmake
matlab-config.cmake
Add the installation prefix of "matlab" to CMAKE_PREFIX_PATH or set "matlab_DIR" to a directory containing one of the above files. If "matlab" provides a separate development package or SDK, be sure it has been installed.
I searched for matlabConfig.cmake or matlab-config.cmake in matlab installation directory but did not find it. Does Matlab provide provide such files or not? If not how to integrate large C++ programs with MATLAB. I dont want to use system function calls as they are too slow.
Mike Croucher
Mike Croucher
上次活动时间: 2025-3-25,11:51

There has been a lot of discussion here about the R2025a Prerelease that has really helped us get it ready for the prime time. Thank you for that!
A new update of the Prerelease has just dropped. So fresh it is still warm from the oven! In my latest blog post I discuss changes in the way MathWorks has been asking-for and processing feedback...and you have all been a part of that.
If you haven't tried the Prerelease in a while, I suggest you update and see how things are looking now.
If you have already submitted a bug report and it hasn't been fixed in this update, you don't need to submit another one. Everything is being tracked!
Have a play, discuss it here and thanks for again for being part of the process.
Bonsoir,
Je suis en train de finaliser Module 4 du cours "Designing and Simulating Physical Models" et j’ai quelques difficultés avec les derniers quiz, notamment ceux liés au projet Simulating Motor Heat Effects.
J’ai suivi toutes les étapes du projet et compris l’utilisation des blocs Relay, PS Product et Thermal Mass, mais j’aimerais avoir des clarifications sur :
Comment tester efficacement mon modèle pour vérifier que la logique de coupure fonctionne bien ?
Quels paramètres thermiques sont les plus critiques pour éviter les erreurs de simulation ?
Y a-t-il des erreurs fréquentes à éviter dans les quiz finaux ?
Si quelqu’un a réussi ces quiz et peut me donner quelques conseils ou orientations, ce serait super !
Merci beaucoup pour votre aide.

Bonsoir

Je me permets de vous contacter afin d’obtenir des informations et un encadrement concernant un projet sur lequel je travaille actuellement. Il s’agit d’une application visant à réguler un oscillateur quantique en potentiel harmonique à l’aide de l’intelligence artificielle.

Plus précisément, mon objectif est de :

Modéliser l’évolution de l’oscillateur quantique sous un potentiel harmonique.

Appliquer des techniques d’IA (réseaux de neurones, renforcement, etc.) pour optimiser la régulation de son état.

Analyser les performances des algorithmes dans le cadre de cette régulation.

Je souhaiterais savoir si vous pourriez m’apporter des conseils ou un encadrement dans la réalisation de ce projet, notamment sur les aspects mathématiques, physiques et computationnels impliqués. De plus, toute suggestion sur des références bibliographiques ou des outils adaptés (MATLAB, Python, TensorFlow, etc.) serait également très précieuse.

Dans l’attente de votre retour, Bien cordialement,

📢 We want to hear from you! We're a team of graduate student researchers at the University of Michigan studying MATLAB Drive and other cloud-based systems for sharing coding files. Your feedback will help improve these tools. Take our quick survey here: https://forms.gle/DnHs4XNAwBZvmrAw6
Hello,
I hope you are doing well. I need your help in developing a Matlab model for the modeling and simulation of the energy and environmental performance of an improved stove (furnace) for the combustion of charcoal briquettes (biochar). I would really appreciate your assistance.
Thank you very much.
Wan Muhamad Hakimi
Wan Muhamad Hakimi
上次活动时间: 2025-3-14,17:27

Hi! I am using F28379D DSP. I would like to generate 20khz and 50% duty cycle. I have use ADC with the input 3Vac from voltage sensor. The TBPRD set is 2500 and the CMP value is 1250 with prescaler 1. EPWM1A and EPWM 1B are utilised in this case. Unfortunately EPWM1A duty cycle is shifting/moving/not in phase, EPWM1B is constantly producing 20khz. I am using updown counter. CAU is set CAD is Clear same goes to EPWM1B. Why this happen? I would like to do a switching where PWM 20khz is on during positive half cycle, PWM 20khz is off during negative half cycle. Appreciate for the help!

Imagine you are developing a new toolbox for MATLAB. You have a folder full of a few .m files defining a bunch of functions and you are thinking 'This would be useful for others, I'm going to make it available to the world'
What process would you go through? What's the first thing you'd do?
I have my own opinions but don't want to pollute the start of the conversation :)
Hello MATLAB Community,
I'm working on a project where I need to model and simulate a generator or motor system in Simulink, and I want to get the output voltage based on certain design parameters, including the number of turns, magnets, and coils.
I’m looking for a Simulink model or component that would allow me to input:
  • The number of turns in the coils
  • The number of magnets
  • The number of coils
And then, based on this design, output the voltage generated by the system.
I would appreciate any guidance on:
  • Specific Simulink components or models that are suited for this purpose
  • Whether there’s a prebuilt block or if I need to build a custom model
  • Any tips or examples that can help me set up this simulation
Thanks in advance for your help!
Best regards,
Siyabonga