Tag Archives: matlab
How do I license my Docker container using a Campus-Wide or Startup Individual license?
How do I license my Docker container using a Campus-Wide or Startup Individual license?How do I license my Docker container using a Campus-Wide or Startup Individual license? How do I license my Docker container using a Campus-Wide or Startup Individual license? MATLAB Answers — New Questions
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in
In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
endIn MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end In MATLAB, when an operation is manually terminated by the user via actions like Ctrl+C, the command line will print a prompt message that includes the relevant line number in legacy versions (e.g., R2016); however, this line number is omitted from the prompt in newer releases such as R2022.
function custom_interrupt_info()
disp(‘程序启动,按下Ctrl+C可中止并显示详细行号…’);
iteration_num = 100000; % 模拟耗时迭代
try
% #################### 你的核心业务代码 ####################
for i = 1:iteration_num
disp([‘当前执行第 ‘, num2str(i), ‘ 次迭代’]);
pause(0.03); % 模拟耗时操作,方便触发Ctrl+C
temp_result = i * 2; % 示例计算逻辑
end
% ##########################################################
finally
% 关键:无论是否中止,都获取并输出完整中止信息(含行号)
disp(‘=====================================================’);
disp(‘==================== 中止详细信息 ====================’);
stack_info = dbstack; % 提取堆栈信息(核心:获取行号)
if ~isempty(stack_info)
% 输出自定义详细信息,包含行号、文件、函数
disp([‘✅ 中止文件:’, stack_info(1).file]);
disp([‘✅ 中止行号:’, num2str(stack_info(1).line)]);
disp([‘✅ 所在脚本/函数:’, stack_info(1).name]);
else
disp(‘✅ 程序正常结束,无中止操作’);
end
disp(‘=====================================================’);
end
end line number, prompt message ctrl+c MATLAB Answers — New Questions
I want to calculate efficiency, response time, and thd for Dynamic voltage restorer with FLC for power quality improvement.
I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate.I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate. I am done with the simulink,now try to calculate the thd ,efficiency and response time.i tried but cannot calculate. simulink, matlab MATLAB Answers — New Questions
TI C2000 I2C Receive with Interrupt not working (Simulink)
Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals.Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals. Hello,
I have a setup with a ESP32S3 Dev-Module as I²C master and a TI C2000 TMS320F28069M board as a I²C slave. The ESP32 is supposed to send the C2000 several signal. Each signal has three bytes. First a comand byte to separate the signals and then two bytes as payload (uint16 or int16). The C2000-code is implemented in Simulink. In the future, the C2000 shall respond to certain signals with data.
My first issue is that the I2C RCV (Receive) Block outputs my signals in a way that the the byte order changes. For example, the comand byte which is supposed to be always the first byte is sometimes the second or third byte. The order changes throughout restarts and is not predictable. As a solution to this problem I want to use I²C interrupts. This brings me to my second and main question:
I can not get the I²C communication to work with the interrupts. My ESP32 stops sending data as soon as the C2000 code with I²C interrupts is uploaded and running. It seems like the I²C ISR of the C2000 is never called and somehow stops the ESP32 from sending further messages.
To diagnose my problem, I already did the following without success:
Added a free-running counter in the ISR-function to see if the function gets called. The counter stays at zero.
Analyzed and used code-fragments of the C2000 c28x_i2c_eeprom_interrupt example in my code.
Checked I²C with oscilloscope and bus-decoder: Without the Interrupts, the I²C Messages are transmitted and acknowledged. With Interrupt, a successful transmission happens exactly one time, then stops. SCL stays low, SDA stays high.
Tried different Interrupts, tried different interrupt settings.
My guesses:
Wrong settings/configuration of ISR/hardware /some registers
Timing problems
Some kind of incompactibility between C2000/ESP32
User error
I attached 4 screenshots of my settings, the my code-example and two screenshots without ISR and two with ISR of my oscilloscope.
I prepared a small Simulink file with my code. If you want to run the code, open "Nur_I2C.slx". Open the subsystem. There are two parts, one with ISR and one without. Just comment one part and uncomment the other. Everything after the delay is for the differentiation of the signals. c2000, i2c, i²c, communication, hardware, isr, interrupt MATLAB Answers — New Questions
Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0 Is there any matlab documentation that can explain why multiplying empty arrays gives zero matrices?
Here is the sample
A=double.empty(5,0);
B=double.empty(0,5);
C=A*B
C =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0 mtimes, empty, arithmetic operations, operators and elementary operations MATLAB Answers — New Questions
How to view private properties of a class in the debugger?
I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken?I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken? I author a handful of Digital Signal Processing algorithms in System objects (they are very handy indeed). Recently after upgrading to R2025b from R2024a I’ve hit an annoying snag. Most of the state, etc. of a system object will be in private properties. In prior versions, I could set a breakpoint in the stepImpl for instance and if I clicked on "obj" (the standard internal name for my object handle inside methods), I could see in the variable editor the value of all the properties, not just the externally visible ones. Then, I could step through the algorithm and make sure everything was computing correctly. Now there’s no handy way to do this? I tried the class browser but that doesn’t readily show the values of the current instance of the class. Why was this critical feature broken? debug, system object MATLAB Answers — New Questions
HDL multi rate simulation
I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity?I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity? I’m having trouble understanding how to speed up the simulation when everything is running at the hardware rate. I have a clock interface that is running at 50 MHz and I have simulink sampling rates set to 20e-9 s and then I have enabled the setting "Treat Simulink rates as actual hardware rates" in order to model to communication interface such as the AXI4 master correctly. However, the simulation comes to crawl even though controller and plant can be run at a slower rate. Is there a way I can speed up the simulation while maintaining cycle accurate fidelity? hdl coder MATLAB Answers — New Questions
Eigenvalue analysis of Outer-tub dynamic assembly of Front load washing machine
Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them?Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them? Hi,
Currently , I am working on an MBD system (Outer-tub dynamic assembly of Front Load washing machine, with two hanging linear springs and 3 friction dampers). I want to compute the linearized dynamic model to perform the Eigenvalue analysis. I am following a research paper by Prof. Bae (An Implementation method of linearized equations of motion for multibody systems with closed loops). I compared the computed stiffness matric with Recurdyn computed stiffness matrix. RecurDyn provided two different stiffness matrices (one for static analysis and another one for Eigenvalue analysis). My stiffness matrix (Python code as Prof Bae paper) is matching with the Recurdyn stiffness matrix computed for static analysis.
I want to know why are these two stiffness matrices of RecurDyn different, and How to compute them? linearized dynamic model, eigenvalue analysis, outer-tub dynamic assembly wit, washing machine, static equilibrium, linear and torsional springs MATLAB Answers — New Questions
How to call the Simulink Test results inside the ForEach module?
Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results?Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results? Hello, I want to use the test results from Simulink Test to perform custom evaluation criteria. My model uses a For Each subsystem externally to calculate the maximum and minimum SOC of individual cells within a battery pack in parallel. The battery SOC is an output of the model, and for each battery’s SOC, I can record and call it using the code below:
soc = test.sltest_simout.get(‘logsout’).get(‘soc’).Values.Data;
soc_max = soc(:,1);
soc_min = soc(:,2);
However, I also want to record the terminal voltage estimation error of a battery inside the For Each subsystem. This value is internal to the For Each subsystem and is not output to the outside of the model. If I try to call the test data in the same way as above, I get an ‘index exceeds 1’ error:
v_error = test.sltest_simout.get(‘logsout’).get(‘v_error’).Values.Data;
v_max_error = v_error(:,1);
v_max_error = v_error(:,2);
In Simulink Test, there are also two output results, but it seems that it calculates them channel by channel. So, how should I call the v_error test results? simulink test, simulink, bms MATLAB Answers — New Questions
Guidance on Space Vector PWM Implementation in Simulink
Dear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi ZapaterDear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi Zapater Dear MathWorks Team,
I am writing to seek guidance on implementing Space Vector Pulse Width Modulation (SVPWM) in Simulink.
In recent releases, specifically MATLAB/Simulink 2025b, the blocks “SVPWM Generator (2-level)” and “SVPWM Generator (3-level)”, which were previously intended for this purpose, are no longer available. According to the documentation on your website, these blocks are expected to be removed.
I would appreciate it if you could advise on recommended alternatives or replacement solutions for implementing SVPWM in Simulink under the current software version. Any guidance toward supported blocks, example models, or best-practice approaches would be very helpful.
Thank you for your time and support.
Sincerely,
Sergi Zapater svpwm, svm, space vector modulation, simulink MATLAB Answers — New Questions
GigE Cam works with 2024B but not 2025B
Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks!Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks! Hello,
I’m currently working with a GigE camera and I tried to update the MATLAB version to 2025B from 2024B.
However after installing the image acquisition toolbox and the GigE adaptor the device can not longer be detected.
I also tested a Point Grey usb camera and it worked fine with 2025B.
Please let me know if you need any other information.
Thanks! image acquisition, gige camera MATLAB Answers — New Questions
Hi, why aren’t these circuits working?
The three phase inverter only converts one period.The three phase inverter only converts one period. The three phase inverter only converts one period. #inverter MATLAB Answers — New Questions
Ffigure saved as pdf: how to get proper control of margins
Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ?Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ? Hello,
I want to save a figure as a pdf, and would like to get control on the margins around the figure in the pdf.
Here is an example :
load(‘test_0.mat’); % contains the variables AudioSnip, frameSize, Hop , fs
s_length = length(AudioSnip);
nframes = 1 + floor((s_length – frameSize)/double(Hop ));
UsableSigLength = frameSize + floor(Hop *floor((s_length – frameSize)/double(Hop )));
sampleTime = ( 1: UsableSigLength )/fs;
%$$$$$$$$$$$$$$$$$$$
[B,f,T] = specgram(AudioSnip,frameSize*2,fs,hanning(frameSize), Hop); %(1: UsableSigLength)
B = 20*log10(abs(B));
%
TheFig = figure;
h = gcf ; %gcf returns the current figure handle
h.Units = ‘centimeters’;
h.PaperType= ‘A4’;
h.PaperUnits = ‘centimeters’;
h.PaperOrientation= ‘landscape’; % ‘portrait’;
h.PaperPositionMode= ‘auto’;
h.InvertHardcopy = ‘on’;
h.Renderer = ‘painter’;
margin = 4.; width = 29.7; height = 21.;
h.Position = [margin margin width-2*margin height-2*margin];
h.PaperSize = [29.7 21.0]; %[21.0000 29.7000];
subplot(2,1,1);
plot(sampleTime, AudioSnip(1: UsableSigLength));
xlabel(‘Time (s)’,’FontSize’, 10, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
ylabel(‘Amplitude’, ‘FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
set(get(gca, ‘xlabel’), ‘Position’, [ 21.,-0.21,-1]);
h1 = gcf;
h1.Units = ‘centimeters’;
atx1= gca; % axes ‘Position’, % xtart, ystart xend yend coord
atx1.Position = [0.1300 0.7099 0.6949 0.1635]; %
atx1.FontSize = 10 ; atx1.FontName = ‘Times’; atx1.FontWeight = ‘bold’;
atx1.Units=’normalized’;
Tt0=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.4599 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘String’, ‘text1’);
Tt1=text(‘Units’,’normalized’,’Position’,[ 0.0009 1.260, 0 ],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,14 , ‘FontWeight’, ‘bold’, ‘FontAngle’, ‘italic’,’String’, ‘text2’);
Tt2=text(‘Units’,’normalized’,’Position’,[0.0009 1.0509 0],…
‘VerticalAlignment’, ‘Bottom’, ‘FontName’, ‘Times’, ‘FontSize’,12 , ‘FontWeight’, ‘bold’, ‘String’, ‘text3’);
subplot(2,1,2);
h2 = gcf;
h2.Units = ‘centimeters’;
atx2= gca; % axes(‘Position’, % xtart, ystart xend yend coord
atx2.FontSize = 10; atx2.FontName= ‘Times’ ; atx2.FontWeight = ‘bold’;
atx2.Units=’normalized’;
atx2.Position = [0.1300 0.0720 0.7334 0.5965 ];
imagesc(T,f,B);axis xy;colorbar;
ylabel(‘Frequency (Hz)’,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
xlabel(”,’FontSize’, 12, ‘FontName’ ,’Times’, ‘FontWeight’, ‘bold’);
colormap jet
exportgraphics(TheFig, ‘outputTest.pdf’);
When I run it,
A) I do not get a proper control on the margins around the figure: the parameter ‘margin’ (see code)does not seem to affect the result in the pdf obtained
What should be done ?
Miscellaneaous other problems:
B) I would like to align the time corresponding to the end of the data (first subplot), with the end of the spectrogram data (2nd subplot): how should this be done ? (I tried some adjustment via axis position, but the colorbar is also messing things up)
C) the font for the 2nd subplot is not the expected ‘Times’; (I tested that it is indeed possible to manually force ‘Times’ using the figure inspector, but not by the program line above (atx2.FontName = ‘Times’)
why ? how to enforce ‘Times’ by programing ? pdf, figure, margin MATLAB Answers — New Questions
When a python command is called for the first time, I get “ERROR:root:code for hash blake2b was not found.”
Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>>Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>> Hello,
When I run MATLAB code that calls Python commands, I get an error message about hash functions.
The following is a shell script called "test_matlab_python.sh":
#!/bin/bash
matlab -nodesktop -nosplash -nodisplay -r "test_matlab_python"
The MATLAB code "test_matlab_python.m" is
clear all;
pe = pyenv(‘Version’,’python3.11′);
res = py.list({‘This’,’is a’,’list’})
exit
When I run the code from a Linux shell, (Fedora Linux version 42)
$ ./test_matlab_python.sh
MATLAB shows an error message:
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2025a Update 1 (25.1.0.2973910) 64-bit (glnxa64)
July 3, 2025
To get started, type doc.
For product information, visit www.mathworks.com.
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
File "/usr/lib64/python3.11/hashlib.py", line 307, in <module>
globals()[__func_name] = __get_hash(__func_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 129, in __get_openssl_constructor
return __get_builtin_constructor(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/hashlib.py", line 123, in __get_builtin_constructor
raise ValueError(‘unsupported hash type ‘ + name)
ValueError: unsupported hash type blake2s
res =
Python list with values:
[‘This’, ‘is a’, ‘list’]
Use string, double or cell function to convert to a MATLAB array.
After showing the message, MATLAB works fine. But is there any way not to see this message?
When I run "test_matlab_python.m" from the MATLAB desktop environemnt in the Fedora Linux, the message was not shown in the command window, but it was shown in the shell that started the desktop as follows:
$ matlab
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
…
ValueError: unsupported hash type blake2s
I never saw this message when I was running normal Python programs:
$ python
Python 3.11.14 (main, Oct 10 2025, 00:00:00) [GCC 15.2.1 20250808 (Red Hat 15.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> list({‘This’,’is a’,’list’})
[‘is a’, ‘This’, ‘list’]
>>> python, hash, blake2b, blake2s MATLAB Answers — New Questions
Running the cloud-based MATLAB for an extended period of time
I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer?I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer? I have a code that can take between 1 up to 4 hours to finish. I want to run the code on the cloud-based platform. However, the problem is that after few minutes the MATLAB site requires some activity (like moving the pointer) in the page or it will log me out automatically.
How can I run the MATLAB code for an extended period of time without me having to be in front of the computer? cloud-based matlab MATLAB Answers — New Questions
How to solve dy/dt=A(t)*y where y is a vector (3 elements) and A is 3×3 matrix with time dependent elements.
The ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard WittebortThe ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard Wittebort The ODE is:
Initial values are Ao=(1,0,0). I have a subroutine that calculates Aij(t). Inputs to this subroutine are a vector of the times, (t(1),t(2)…..t(N)), and 2 vectors with parameters required to calculate R(i,j,t(k)). Please let me know what, if any, Matlab routines can be used for this purpose.
Thanks, Richard Wittebort matrix ode, time dependent coefficients MATLAB Answers — New Questions
Plotting two x axis in one plot, but both at the bottom.
Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom.Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom. Hi I am looking for a way to plot two x axis but both x-axis has to be in the bottom. Like shown here in the picture. The only thing I can find is where the two x-axis are on top and bottom of the plot, where I want them both on bottom. plot, multi axis MATLAB Answers — New Questions
Unexpected error referring pi_gene_mci_glnxa64
Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a>Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a> Receiving such error messages when starting a batch job on R2025a. However the job starts after about a minute.We don’t see such errors in older versions. Are there any major changes in R2025a that are causing these. How to remove/disable them
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci_glnxa64">Technical Support</a>.
An unexpected error has occurred. To resolve this issue, contact <a href="https://www.mathworks.com/pi_gene_mci">Technical Support</a> pi_gene_mci_glnxa64 MATLAB Answers — New Questions
symbolic substitution error and convert
syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted insyms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in syms x
series1(x)=sym(zeros(1));
series2(x)=sym(zeros(1));
U=zeros(1,2,’sym’);
syms x m z
alpha=15;
gamma=0.01;
U(1)=m;
U(2)=0;
A(1)=zeros(1,’sym’);
for k=1
U(k+2)=z;
A(1)=0;
for m=1:k
A(1)=A(1)+U(m)*(k-m+1)*(k-m+2)*U(k-m+3);
end
B=k*(k+1)*U(k+2)+alpha*A(1)-gamma*U(k)
D=simplify(solve(B,z))
U(k+2)=D
end
disp(U(3))
for k=1:3
series1(x)=simplify(series1(x)+U(k)*(power(x,k-1)));
end
series1
e1=subs(series1,x,1);
e=e1-1;
format long
accuracy=input(‘enter the accuracy’)
f=e(x)
g=inline(f)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c)
series2(x)=subs(series1,m,c)
toc
the synatx is correct but still the value of m is not substituted in mbolic computation MATLAB Answers — New Questions
Range-Doppler tracking radar against coherent ecm techniques
Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively.Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively. Hello everyone,
I aim to design a radar system with coherent tracking capability in MATLAB 2025b. As a representative scenario, I consider four aircraft approaching and receding from the radar. Among these four aircraft, two apply coherent electronic countermeasure (ECM) techniques against the radar in both the range and Doppler domains, while the remaining two do not perform coherent jamming with respect to the range–Doppler relationship.
The main objective is for the designed radar to first detect all four aircraft using its own transmitted and received signals, and to generate a target detection plot in the amplitude–time domain. Subsequently, the aircraft apply the specified jamming techniques against the radar. As a result of the jamming, the radar’s immunity to interference in terms of coherent tracking performance is evaluated, and the resulting tracking errors are presented as percentage error plots.
As an illustrative case, one of the aircraft applying coherent jamming may successfully deceive the radar, whereas the other may continue to be tracked with a certain level of tracking error. The remaining two aircraft, which do not employ coherent jamming, are expected to be identified by the radar as jamming sources, allowing the radar to reject the interference and continue tracking the true targets.
I have already developed a MATLAB code for this purpose; however, I have not been able to obtain the desired results. My primary goal is to apply different jamming parameter configurations against the radar, analyze the resulting tracking error rates, and investigate how these parameters affect the radar’s ability to maintain target tracking.
I would greatly appreciate any guidance or suggestions on how to approach this problem more effectively. radar, range-doppler, coherent tracking radar, ecm, range doppler coherency, coherent, kalman MATLAB Answers — New Questions









