Category: Matlab
Category Archives: Matlab
Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer?
Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer?Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer? Why do I receive a connection error when accessing Add-Ons Explorer or the Software Support Installer? MATLAB Answers — New Questions
Why do I receive a connection error when launching MATLAB with Login Named User enabled?
Why do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection ErrorWhy do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection Error Why do I receive the following error when launching MATLAB with Login Named User (LNU) enabled:
Connection Error login, named, user, lnu, licensing, servers MATLAB Answers — New Questions
Timetables not fully supported by plot tools?
Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases.Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases. Hello,
I am just wondering why when plotting a timetable with duration as time axis, The "basic fitting" and "data statistics" tool in plot windos are not available.
Does this mean that timetables have some limitations compared to arrays or tables? I am asking because I need to decide if timetable is the right data structure for my use case. Basically I am importing some measuremet datas from sensors acquisition which have timestamps. In the past I would have just used plain arrays, but I see that in modern Matlab timetables are somehow suggested for these use cases. time series, data import MATLAB Answers — New Questions
General Blockproc questions that aren’t in the documentation
I have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
JasonI have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
Jason I have 4 question’s regarding Blockproc.
1: When you take an image and break it up into smaller images (ROI’s) to use blockproc, what is the exact order of the smaller images
In my image below, the yellow box is "top-left"
Q2: Also, is there away to show grid lines like above just to verify where blockproc has operated?
Q3: Is it possible to use blockproc and NOT operate on all the smaller images, i.e. just the images where the cyan circles are?
Q4: Can you combine functions so blockproc doesn’t have to run twice, e.g.:
fun = @(block_struct) mean2(block_struct.data);
AVG = blockproc(IM2,[500 500],fun,’UseParallel’,true);
fun2 = @(block_struct) std2(block_struct.data);
SD = blockproc(IM2,[500 500],fun2,’UseParallel’,true)
Thanks
Jason blockproc MATLAB Answers — New Questions
How can I set an expiration or override date for my license file?
How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself?How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? How can I set an expiration (override) date for my license file? Can this date be different from the expiration date of the license itself? MATLAB Answers — New Questions
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
Can I remove MATLAB DMR files from the temp directory?
I have been using MATLAB & Simulink for a few months, and my C drive now contains many MATLAB temporary files with the extension .dmr. Can I delete these files?I have been using MATLAB & Simulink for a few months, and my C drive now contains many MATLAB temporary files with the extension .dmr. Can I delete these files? I have been using MATLAB & Simulink for a few months, and my C drive now contains many MATLAB temporary files with the extension .dmr. Can I delete these files? dmr, tempfile, simulink, sdi MATLAB Answers — New Questions
Dealing with Duration format
I have a file containing the values of the position of the body’s center of pressure, calculated during the trial. I would like to plot the time elapsed (which has the format ‘0:0:0:064’) vs the position. When I open the file (.xlsx) with "readtable", it reads me all the values as "string" and not numbers. I tried to solve this with "str2double", and while this works for the position column, is useless for the time elapsed. When I change the extension (i.e. .csv orb .txt) it converts all the durations into NaNs, even though in the "Import Data" mask it is written at the top of the time elapsed column "duration". As a result, I cannot plot the time on the x-axis.
If I run this piece of code for example:
data = readtable("AdaptationTestProva.xlsx");
x = str2double(data.x_StaticVR_RawMediolateralAxis);
y = str2double(data.TimeElapsed);
plot(y,x)
I get an empty graph.
What can I do to get a standard graph with a usable elapsed time?
If this can be helpful, I’ll leave attached an example of the file.I have a file containing the values of the position of the body’s center of pressure, calculated during the trial. I would like to plot the time elapsed (which has the format ‘0:0:0:064’) vs the position. When I open the file (.xlsx) with "readtable", it reads me all the values as "string" and not numbers. I tried to solve this with "str2double", and while this works for the position column, is useless for the time elapsed. When I change the extension (i.e. .csv orb .txt) it converts all the durations into NaNs, even though in the "Import Data" mask it is written at the top of the time elapsed column "duration". As a result, I cannot plot the time on the x-axis.
If I run this piece of code for example:
data = readtable("AdaptationTestProva.xlsx");
x = str2double(data.x_StaticVR_RawMediolateralAxis);
y = str2double(data.TimeElapsed);
plot(y,x)
I get an empty graph.
What can I do to get a standard graph with a usable elapsed time?
If this can be helpful, I’ll leave attached an example of the file. I have a file containing the values of the position of the body’s center of pressure, calculated during the trial. I would like to plot the time elapsed (which has the format ‘0:0:0:064’) vs the position. When I open the file (.xlsx) with "readtable", it reads me all the values as "string" and not numbers. I tried to solve this with "str2double", and while this works for the position column, is useless for the time elapsed. When I change the extension (i.e. .csv orb .txt) it converts all the durations into NaNs, even though in the "Import Data" mask it is written at the top of the time elapsed column "duration". As a result, I cannot plot the time on the x-axis.
If I run this piece of code for example:
data = readtable("AdaptationTestProva.xlsx");
x = str2double(data.x_StaticVR_RawMediolateralAxis);
y = str2double(data.TimeElapsed);
plot(y,x)
I get an empty graph.
What can I do to get a standard graph with a usable elapsed time?
If this can be helpful, I’ll leave attached an example of the file. #duration, #plot, #conversion 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
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
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









