Category: News
I have two same errors every time i paste a code to check
This is my task and here is code:
% Load the x-y-z positions into the variable R
load datafile.mat
m = 1.2; % particle mass in kg
% Find the center of mass location in a row vector rcm
rcm = mean(R);
% Find the moment of inertia matrix I, a 3-by-3 matrix
Ixx = sum(m*(R(:,2).^2+R(:,3).^2));
Iyy = sum(m*(R(:,1).^2 + R(:,3).^2));
Izz = sum(m*(R(:,1).^2 + R(:,2).^2));
Ixy = -sum(m * R(:,1) .* R(:,2));
Ixz = -sum(m * R(:,1) .* R(:,3));
Iyz = -sum(m * R(:,2) .*R(:,3));
% Composite main inertia matrix I
I = [ Ixx, Ixy, Ixz;
Ixy, Iyy, Iyz;
Ixz, Iyz, Izz ];
% Find the principal moment of inertia
[~,II] = eig(I);
and the errors are
I tried many different methods to solve this but non of them worked :/, thanks for any helpThis is my task and here is code:
% Load the x-y-z positions into the variable R
load datafile.mat
m = 1.2; % particle mass in kg
% Find the center of mass location in a row vector rcm
rcm = mean(R);
% Find the moment of inertia matrix I, a 3-by-3 matrix
Ixx = sum(m*(R(:,2).^2+R(:,3).^2));
Iyy = sum(m*(R(:,1).^2 + R(:,3).^2));
Izz = sum(m*(R(:,1).^2 + R(:,2).^2));
Ixy = -sum(m * R(:,1) .* R(:,2));
Ixz = -sum(m * R(:,1) .* R(:,3));
Iyz = -sum(m * R(:,2) .*R(:,3));
% Composite main inertia matrix I
I = [ Ixx, Ixy, Ixz;
Ixy, Iyy, Iyz;
Ixz, Iyz, Izz ];
% Find the principal moment of inertia
[~,II] = eig(I);
and the errors are
I tried many different methods to solve this but non of them worked :/, thanks for any help This is my task and here is code:
% Load the x-y-z positions into the variable R
load datafile.mat
m = 1.2; % particle mass in kg
% Find the center of mass location in a row vector rcm
rcm = mean(R);
% Find the moment of inertia matrix I, a 3-by-3 matrix
Ixx = sum(m*(R(:,2).^2+R(:,3).^2));
Iyy = sum(m*(R(:,1).^2 + R(:,3).^2));
Izz = sum(m*(R(:,1).^2 + R(:,2).^2));
Ixy = -sum(m * R(:,1) .* R(:,2));
Ixz = -sum(m * R(:,1) .* R(:,3));
Iyz = -sum(m * R(:,2) .*R(:,3));
% Composite main inertia matrix I
I = [ Ixx, Ixy, Ixz;
Ixy, Iyy, Iyz;
Ixz, Iyz, Izz ];
% Find the principal moment of inertia
[~,II] = eig(I);
and the errors are
I tried many different methods to solve this but non of them worked :/, thanks for any help moment of inertia, matrix MATLAB Answers — New Questions
Fitting exponential function, coefficients and errors
Dear experts,
I have experimental data for exponential distribution a*exp(b*x). I need to find coefficients a, b and their errors. I have used function fit(B,C, ‘exp1’) and I got some results. I have problem because some data points in my file have higher error rate because of the nature of experiment.
1.) Which algorithm or function in Matlab can give the smallest error ?
2.) How can I use/adopt some function in Matlab to put smaller weight (when I calculate coefficients) on data that drastically differ from exponential function ?
Thank you.Dear experts,
I have experimental data for exponential distribution a*exp(b*x). I need to find coefficients a, b and their errors. I have used function fit(B,C, ‘exp1’) and I got some results. I have problem because some data points in my file have higher error rate because of the nature of experiment.
1.) Which algorithm or function in Matlab can give the smallest error ?
2.) How can I use/adopt some function in Matlab to put smaller weight (when I calculate coefficients) on data that drastically differ from exponential function ?
Thank you. Dear experts,
I have experimental data for exponential distribution a*exp(b*x). I need to find coefficients a, b and their errors. I have used function fit(B,C, ‘exp1’) and I got some results. I have problem because some data points in my file have higher error rate because of the nature of experiment.
1.) Which algorithm or function in Matlab can give the smallest error ?
2.) How can I use/adopt some function in Matlab to put smaller weight (when I calculate coefficients) on data that drastically differ from exponential function ?
Thank you. fitting exponential function MATLAB Answers — New Questions
Matlab crash on startup
./matlab
MATLAB is selecting SOFTWARE rendering.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QXcbGlxIntegration::initialize
Xcb GLX gl-integration successfully initialized
——————————————————————————–
Segmentation violation detected at 2025-11-08 15:30:44 +0100
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : KDE
GNU C Library : 2.42 stable
Graphics Driver : Uninitialized software
Graphics card 1 : Not Started 0x10de ( 0x10de ) 0x28e1 Version 0.0.0.0 (0-0-0)
Graphics card 2 : 0x1002 ( 0x1002 ) 0x1901 Version 0.0.0.0 (0-0-0)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5229650
MATLAB Root : /home/question/MATLAB
MATLAB Version : 24.2.0.2923080 (R2024b) Update 6
OpenGL : software
Operating System : "CachyOS"
Process ID : 5316
Processor ID : x86 Family 25 Model 124 Stepping 0, AuthenticAMD
Session Key : 1b93d498-7911-4e43-b8ff-23a17ac7c520
Window System : The X.Org Foundation (12401009), display :0
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ‘MCR 0 interpret’ id 140540391716544
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 00007fd1a40008e0 RDX = 0000000000000010
RSP = 00007fd21c1fa730 RBP = 00000000444d4163
RSI = 0000000000000000 RDI = 00007fd1a4584fb0
R8 = 00007fd1a4000090 R9 = 0000000000000030
R10 = 0000000000000030 R11 = 00007fd1a4000030
R12 = 0000000000000000 R13 = 00007fd1a4b73b70
R14 = 0000000000000000 R15 = 0000000000000001
RIP = 00007fd289831c38 EFL = 0000000000010246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd289831c38 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02300984 Ox3204a7d97fd297a1+00000552
[ 1] 0x00007fd289832977 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02304375 lc_init+00000055
[ 2] 0x00007fd13ee646a8 /usr/lib/libgnutls.so.30+00411304
[ 3] 0x00007fd13ee264ef /usr/lib/libgnutls.so.30+00156911
[ 4] 0x00007fd35390ac7e /lib64/ld-linux-x86-64.so.2+00027774
[ 5] 0x00007fd35390ad83 /lib64/ld-linux-x86-64.so.2+00028035
[ 6] 0x00007fd353906557 /lib64/ld-linux-x86-64.so.2+00009559 _dl_catch_exception+00000279
[ 7] 0x00007fd353913078 /lib64/ld-linux-x86-64.so.2+00061560
[ 8] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 9] 0x00007fd353913566 /lib64/ld-linux-x86-64.so.2+00062822
[ 10] 0x00007fd351aa5f4c /usr/lib/libc.so.6+00679756
[ 11] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 12] 0x00007fd353906603 /lib64/ld-linux-x86-64.so.2+00009731
[ 13] 0x00007fd351aa59d7 /usr/lib/libc.so.6+00678359
[ 14] 0x00007fd351aa6019 /usr/lib/libc.so.6+00679961 dlopen+00000121
[ 15] 0x00007fd28a50e9e1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09497057
[ 16] 0x00007fd28a2fc539 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07324985 JVM_LoadLibrary+00000153
[ 17] 0x00007fd23980e380 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/libjava.so+00058240 Java_java_lang_ClassLoader_00024NativeLibrary_load+00000416
[ 18] 0x00007fd225018087 <unknown-module>+00000000
[ 19] 0x00007fd2250082bd <unknown-module>+00000000
[ 20] 0x00007fd225007a90 <unknown-module>+00000000
[ 21] 0x00007fd2250082bd <unknown-module>+00000000
[ 22] 0x00007fd2250082bd <unknown-module>+00000000
[ 23] 0x00007fd2250082bd <unknown-module>+00000000
[ 24] 0x00007fd2250082bd <unknown-module>+00000000
[ 25] 0x00007fd225008040 <unknown-module>+00000000
[ 26] 0x00007fd225008040 <unknown-module>+00000000
[ 27] 0x00007fd2250082bd <unknown-module>+00000000
[ 28] 0x00007fd2250082bd <unknown-module>+00000000
[ 29] 0x00007fd2250082bd <unknown-module>+00000000
[ 30] 0x00007fd2250082bd <unknown-module>+00000000
[ 31] 0x00007fd2250082bd <unknown-module>+00000000
[ 32] 0x00007fd225008114 <unknown-module>+00000000
[ 33] 0x00007fd225008040 <unknown-module>+00000000
[ 34] 0x00007fd225008040 <unknown-module>+00000000
[ 35] 0x00007fd225008040 <unknown-module>+00000000
[ 36] 0x00007fd225008040 <unknown-module>+00000000
[ 37] 0x00007fd225008040 <unknown-module>+00000000
[ 38] 0x00007fd2250082bd <unknown-module>+00000000
[ 39] 0x00007fd225e33c4c <unknown-module>+00000000
[ 40] 0x00007fd2250082bd <unknown-module>+00000000
[ 41] 0x00007fd2250082bd <unknown-module>+00000000
[ 42] 0x00007fd225008040 <unknown-module>+00000000
[ 43] 0x00007fd2250007a7 <unknown-module>+00000000
[ 44] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 45] 0x00007fd28a3005e4 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07341540 JVM_DoPrivileged+00001268
[ 46] 0x00007fd2253938d5 <unknown-module>+00000000
[ 47] 0x00007fd225d10784 <unknown-module>+00000000
[ 48] 0x00007fd225d132fc <unknown-module>+00000000
[ 49] 0x00007fd2250082bd <unknown-module>+00000000
[ 50] 0x00007fd2250082bd <unknown-module>+00000000
[ 51] 0x00007fd2250082bd <unknown-module>+00000000
[ 52] 0x00007fd2250082bd <unknown-module>+00000000
[ 53] 0x00007fd2250007a7 <unknown-module>+00000000
[ 54] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 55] 0x00007fd28a285c63 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06839395
[ 56] 0x00007fd28a286227 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06840871
[ 57] 0x00007fd28a2f239c /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07283612
[ 58] 0x00007fd28a67b9eb /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992107
[ 59] 0x00007fd28a67bcf1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992881
[ 60] 0x00007fd28a50d8c2 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09492674
[ 61] 0x00007fd351aaa4f8 /usr/lib/libc.so.6+00697592
[ 62] 0x00007fd351b40fdc /usr/lib/libc.so.6+01314780
** This crash report has been saved to disk as /home/question/matlab_crash_dump.5316-1 **
MATLAB is exiting because of fatal error
fish: Job 1, ‘./matlab’ terminated by signal SIGKILL (Forced quit)
~/MATLAB/bin 13s
❯ ./matlab -nojvm
MATLAB is selecting SOFTWARE rendering.
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2024b Update 6 (24.2.0.2923080) 64-bit (glnxa64)
March 28, 2025
For online documentation, see https://www.mathworks.com/support
For product information, visit www.mathworks.com../matlab
MATLAB is selecting SOFTWARE rendering.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QXcbGlxIntegration::initialize
Xcb GLX gl-integration successfully initialized
——————————————————————————–
Segmentation violation detected at 2025-11-08 15:30:44 +0100
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : KDE
GNU C Library : 2.42 stable
Graphics Driver : Uninitialized software
Graphics card 1 : Not Started 0x10de ( 0x10de ) 0x28e1 Version 0.0.0.0 (0-0-0)
Graphics card 2 : 0x1002 ( 0x1002 ) 0x1901 Version 0.0.0.0 (0-0-0)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5229650
MATLAB Root : /home/question/MATLAB
MATLAB Version : 24.2.0.2923080 (R2024b) Update 6
OpenGL : software
Operating System : "CachyOS"
Process ID : 5316
Processor ID : x86 Family 25 Model 124 Stepping 0, AuthenticAMD
Session Key : 1b93d498-7911-4e43-b8ff-23a17ac7c520
Window System : The X.Org Foundation (12401009), display :0
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ‘MCR 0 interpret’ id 140540391716544
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 00007fd1a40008e0 RDX = 0000000000000010
RSP = 00007fd21c1fa730 RBP = 00000000444d4163
RSI = 0000000000000000 RDI = 00007fd1a4584fb0
R8 = 00007fd1a4000090 R9 = 0000000000000030
R10 = 0000000000000030 R11 = 00007fd1a4000030
R12 = 0000000000000000 R13 = 00007fd1a4b73b70
R14 = 0000000000000000 R15 = 0000000000000001
RIP = 00007fd289831c38 EFL = 0000000000010246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd289831c38 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02300984 Ox3204a7d97fd297a1+00000552
[ 1] 0x00007fd289832977 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02304375 lc_init+00000055
[ 2] 0x00007fd13ee646a8 /usr/lib/libgnutls.so.30+00411304
[ 3] 0x00007fd13ee264ef /usr/lib/libgnutls.so.30+00156911
[ 4] 0x00007fd35390ac7e /lib64/ld-linux-x86-64.so.2+00027774
[ 5] 0x00007fd35390ad83 /lib64/ld-linux-x86-64.so.2+00028035
[ 6] 0x00007fd353906557 /lib64/ld-linux-x86-64.so.2+00009559 _dl_catch_exception+00000279
[ 7] 0x00007fd353913078 /lib64/ld-linux-x86-64.so.2+00061560
[ 8] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 9] 0x00007fd353913566 /lib64/ld-linux-x86-64.so.2+00062822
[ 10] 0x00007fd351aa5f4c /usr/lib/libc.so.6+00679756
[ 11] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 12] 0x00007fd353906603 /lib64/ld-linux-x86-64.so.2+00009731
[ 13] 0x00007fd351aa59d7 /usr/lib/libc.so.6+00678359
[ 14] 0x00007fd351aa6019 /usr/lib/libc.so.6+00679961 dlopen+00000121
[ 15] 0x00007fd28a50e9e1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09497057
[ 16] 0x00007fd28a2fc539 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07324985 JVM_LoadLibrary+00000153
[ 17] 0x00007fd23980e380 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/libjava.so+00058240 Java_java_lang_ClassLoader_00024NativeLibrary_load+00000416
[ 18] 0x00007fd225018087 <unknown-module>+00000000
[ 19] 0x00007fd2250082bd <unknown-module>+00000000
[ 20] 0x00007fd225007a90 <unknown-module>+00000000
[ 21] 0x00007fd2250082bd <unknown-module>+00000000
[ 22] 0x00007fd2250082bd <unknown-module>+00000000
[ 23] 0x00007fd2250082bd <unknown-module>+00000000
[ 24] 0x00007fd2250082bd <unknown-module>+00000000
[ 25] 0x00007fd225008040 <unknown-module>+00000000
[ 26] 0x00007fd225008040 <unknown-module>+00000000
[ 27] 0x00007fd2250082bd <unknown-module>+00000000
[ 28] 0x00007fd2250082bd <unknown-module>+00000000
[ 29] 0x00007fd2250082bd <unknown-module>+00000000
[ 30] 0x00007fd2250082bd <unknown-module>+00000000
[ 31] 0x00007fd2250082bd <unknown-module>+00000000
[ 32] 0x00007fd225008114 <unknown-module>+00000000
[ 33] 0x00007fd225008040 <unknown-module>+00000000
[ 34] 0x00007fd225008040 <unknown-module>+00000000
[ 35] 0x00007fd225008040 <unknown-module>+00000000
[ 36] 0x00007fd225008040 <unknown-module>+00000000
[ 37] 0x00007fd225008040 <unknown-module>+00000000
[ 38] 0x00007fd2250082bd <unknown-module>+00000000
[ 39] 0x00007fd225e33c4c <unknown-module>+00000000
[ 40] 0x00007fd2250082bd <unknown-module>+00000000
[ 41] 0x00007fd2250082bd <unknown-module>+00000000
[ 42] 0x00007fd225008040 <unknown-module>+00000000
[ 43] 0x00007fd2250007a7 <unknown-module>+00000000
[ 44] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 45] 0x00007fd28a3005e4 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07341540 JVM_DoPrivileged+00001268
[ 46] 0x00007fd2253938d5 <unknown-module>+00000000
[ 47] 0x00007fd225d10784 <unknown-module>+00000000
[ 48] 0x00007fd225d132fc <unknown-module>+00000000
[ 49] 0x00007fd2250082bd <unknown-module>+00000000
[ 50] 0x00007fd2250082bd <unknown-module>+00000000
[ 51] 0x00007fd2250082bd <unknown-module>+00000000
[ 52] 0x00007fd2250082bd <unknown-module>+00000000
[ 53] 0x00007fd2250007a7 <unknown-module>+00000000
[ 54] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 55] 0x00007fd28a285c63 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06839395
[ 56] 0x00007fd28a286227 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06840871
[ 57] 0x00007fd28a2f239c /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07283612
[ 58] 0x00007fd28a67b9eb /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992107
[ 59] 0x00007fd28a67bcf1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992881
[ 60] 0x00007fd28a50d8c2 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09492674
[ 61] 0x00007fd351aaa4f8 /usr/lib/libc.so.6+00697592
[ 62] 0x00007fd351b40fdc /usr/lib/libc.so.6+01314780
** This crash report has been saved to disk as /home/question/matlab_crash_dump.5316-1 **
MATLAB is exiting because of fatal error
fish: Job 1, ‘./matlab’ terminated by signal SIGKILL (Forced quit)
~/MATLAB/bin 13s
❯ ./matlab -nojvm
MATLAB is selecting SOFTWARE rendering.
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2024b Update 6 (24.2.0.2923080) 64-bit (glnxa64)
March 28, 2025
For online documentation, see https://www.mathworks.com/support
For product information, visit www.mathworks.com. ./matlab
MATLAB is selecting SOFTWARE rendering.
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
QXcbGlxIntegration::initialize
Xcb GLX gl-integration successfully initialized
——————————————————————————–
Segmentation violation detected at 2025-11-08 15:30:44 +0100
——————————————————————————–
Configuration:
Crash Decoding : Disabled – No sandbox or build area path
Crash Mode : continue (default)
Default Encoding : UTF-8
Deployed : false
Desktop Environment : KDE
GNU C Library : 2.42 stable
Graphics Driver : Uninitialized software
Graphics card 1 : Not Started 0x10de ( 0x10de ) 0x28e1 Version 0.0.0.0 (0-0-0)
Graphics card 2 : 0x1002 ( 0x1002 ) 0x1901 Version 0.0.0.0 (0-0-0)
Java Version : Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
MATLAB Architecture : glnxa64
MATLAB Entitlement ID : 5229650
MATLAB Root : /home/question/MATLAB
MATLAB Version : 24.2.0.2923080 (R2024b) Update 6
OpenGL : software
Operating System : "CachyOS"
Process ID : 5316
Processor ID : x86 Family 25 Model 124 Stepping 0, AuthenticAMD
Session Key : 1b93d498-7911-4e43-b8ff-23a17ac7c520
Window System : The X.Org Foundation (12401009), display :0
Fault Count: 1
Abnormal termination:
Segmentation violation
Current Thread: ‘MCR 0 interpret’ id 140540391716544
Register State (from fault):
RAX = 0000000000000000 RBX = 0000000000000000
RCX = 00007fd1a40008e0 RDX = 0000000000000010
RSP = 00007fd21c1fa730 RBP = 00000000444d4163
RSI = 0000000000000000 RDI = 00007fd1a4584fb0
R8 = 00007fd1a4000090 R9 = 0000000000000030
R10 = 0000000000000030 R11 = 00007fd1a4000030
R12 = 0000000000000000 R13 = 00007fd1a4b73b70
R14 = 0000000000000000 R15 = 0000000000000001
RIP = 00007fd289831c38 EFL = 0000000000010246
CS = 0033 FS = 0000 GS = 0000
Stack Trace (from fault):
[ 0] 0x00007fd289831c38 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02300984 Ox3204a7d97fd297a1+00000552
[ 1] 0x00007fd289832977 /home/question/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so+02304375 lc_init+00000055
[ 2] 0x00007fd13ee646a8 /usr/lib/libgnutls.so.30+00411304
[ 3] 0x00007fd13ee264ef /usr/lib/libgnutls.so.30+00156911
[ 4] 0x00007fd35390ac7e /lib64/ld-linux-x86-64.so.2+00027774
[ 5] 0x00007fd35390ad83 /lib64/ld-linux-x86-64.so.2+00028035
[ 6] 0x00007fd353906557 /lib64/ld-linux-x86-64.so.2+00009559 _dl_catch_exception+00000279
[ 7] 0x00007fd353913078 /lib64/ld-linux-x86-64.so.2+00061560
[ 8] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 9] 0x00007fd353913566 /lib64/ld-linux-x86-64.so.2+00062822
[ 10] 0x00007fd351aa5f4c /usr/lib/libc.so.6+00679756
[ 11] 0x00007fd3539064c4 /lib64/ld-linux-x86-64.so.2+00009412 _dl_catch_exception+00000132
[ 12] 0x00007fd353906603 /lib64/ld-linux-x86-64.so.2+00009731
[ 13] 0x00007fd351aa59d7 /usr/lib/libc.so.6+00678359
[ 14] 0x00007fd351aa6019 /usr/lib/libc.so.6+00679961 dlopen+00000121
[ 15] 0x00007fd28a50e9e1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09497057
[ 16] 0x00007fd28a2fc539 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07324985 JVM_LoadLibrary+00000153
[ 17] 0x00007fd23980e380 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/libjava.so+00058240 Java_java_lang_ClassLoader_00024NativeLibrary_load+00000416
[ 18] 0x00007fd225018087 <unknown-module>+00000000
[ 19] 0x00007fd2250082bd <unknown-module>+00000000
[ 20] 0x00007fd225007a90 <unknown-module>+00000000
[ 21] 0x00007fd2250082bd <unknown-module>+00000000
[ 22] 0x00007fd2250082bd <unknown-module>+00000000
[ 23] 0x00007fd2250082bd <unknown-module>+00000000
[ 24] 0x00007fd2250082bd <unknown-module>+00000000
[ 25] 0x00007fd225008040 <unknown-module>+00000000
[ 26] 0x00007fd225008040 <unknown-module>+00000000
[ 27] 0x00007fd2250082bd <unknown-module>+00000000
[ 28] 0x00007fd2250082bd <unknown-module>+00000000
[ 29] 0x00007fd2250082bd <unknown-module>+00000000
[ 30] 0x00007fd2250082bd <unknown-module>+00000000
[ 31] 0x00007fd2250082bd <unknown-module>+00000000
[ 32] 0x00007fd225008114 <unknown-module>+00000000
[ 33] 0x00007fd225008040 <unknown-module>+00000000
[ 34] 0x00007fd225008040 <unknown-module>+00000000
[ 35] 0x00007fd225008040 <unknown-module>+00000000
[ 36] 0x00007fd225008040 <unknown-module>+00000000
[ 37] 0x00007fd225008040 <unknown-module>+00000000
[ 38] 0x00007fd2250082bd <unknown-module>+00000000
[ 39] 0x00007fd225e33c4c <unknown-module>+00000000
[ 40] 0x00007fd2250082bd <unknown-module>+00000000
[ 41] 0x00007fd2250082bd <unknown-module>+00000000
[ 42] 0x00007fd225008040 <unknown-module>+00000000
[ 43] 0x00007fd2250007a7 <unknown-module>+00000000
[ 44] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 45] 0x00007fd28a3005e4 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07341540 JVM_DoPrivileged+00001268
[ 46] 0x00007fd2253938d5 <unknown-module>+00000000
[ 47] 0x00007fd225d10784 <unknown-module>+00000000
[ 48] 0x00007fd225d132fc <unknown-module>+00000000
[ 49] 0x00007fd2250082bd <unknown-module>+00000000
[ 50] 0x00007fd2250082bd <unknown-module>+00000000
[ 51] 0x00007fd2250082bd <unknown-module>+00000000
[ 52] 0x00007fd2250082bd <unknown-module>+00000000
[ 53] 0x00007fd2250007a7 <unknown-module>+00000000
[ 54] 0x00007fd28a28839b /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06849435
[ 55] 0x00007fd28a285c63 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06839395
[ 56] 0x00007fd28a286227 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+06840871
[ 57] 0x00007fd28a2f239c /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+07283612
[ 58] 0x00007fd28a67b9eb /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992107
[ 59] 0x00007fd28a67bcf1 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+10992881
[ 60] 0x00007fd28a50d8c2 /home/question/MATLAB/sys/java/jre/glnxa64/jre/lib/amd64/server/libjvm.so+09492674
[ 61] 0x00007fd351aaa4f8 /usr/lib/libc.so.6+00697592
[ 62] 0x00007fd351b40fdc /usr/lib/libc.so.6+01314780
** This crash report has been saved to disk as /home/question/matlab_crash_dump.5316-1 **
MATLAB is exiting because of fatal error
fish: Job 1, ‘./matlab’ terminated by signal SIGKILL (Forced quit)
~/MATLAB/bin 13s
❯ ./matlab -nojvm
MATLAB is selecting SOFTWARE rendering.
< M A T L A B (R) >
Copyright 1984-2024 The MathWorks, Inc.
R2024b Update 6 (24.2.0.2923080) 64-bit (glnxa64)
March 28, 2025
For online documentation, see https://www.mathworks.com/support
For product information, visit www.mathworks.com. crash, graphics MATLAB Answers — New Questions
Trouble removing gravity from calibrated IMU acceleration (dual ICM-20948 + quaternions)
Hi everyone,
I’m working on a project where I collect motion data using two ICM-20948 IMUs connected to an ESP32. I apply a 6-pose accelerometer calibration on the microcontroller and later process the data in MATLAB to obtain linear acceleration in the global frame (gravity-free). However, even after rotating the accelerometer data using the quaternions and subtracting gravity, the results still don’t look correct.
Before assuming my processing is wrong, I want to double-check with the community whether my MATLAB approach for gravity removal is correct — and whether I’m handling the quaternion convention properly.📍 Data Acquisition Pipeline (short summary)
Hardware: ESP32 + 2× ICM-20948
I use the ICM20948_WE library
On the ESP32 I:✅ Read accel & gyro✅ Apply bias + gain from 6-pose calibration✅ Log calibrated accel (in g), calibrated gyro, and quaternions
No magnetometer used (so yaw may drift, but recordings are 30–120 s only)
Data is saved as:
q0 q1 q2 q3 ax ay az gx gy gz
🧠 MATLAB Processing (core part of code)
Below is the section where I align the IMU with the global frame and remove gravity. I use the first ~5 s (static) to estimate the gravity direction, align the IMU Z-axis to global Z, rotate accel using the quaternions, and subtract gravity:
%% CORREÇÃO DA ORIENTAÇÃO INICIAL (PERÍODO PARADO)
fprintf(‘n— Correção da Orientação Inicial (5 s parado) —n’);
G = 9.80665; % m/s²
Fs_my = 1 / mean(diff(T.t_s));
Nrest = round(5 * Fs_my);
% IMU1
a1_rest = [T.a1x(1:Nrest), T.a1y(1:Nrest), T.a1z(1:Nrest)];
g_est1 = mean(a1_rest, 1);
g_est1 = g_est1 / norm(g_est1);
% direção da gravidade medida
% Quaternion inicial
Q1 = [T.q10, T.q11, T.q12, T.q13];
if mean(abs(Q1(:,1))) < mean(abs(Q1(:,4)))
Q1 = [Q1(:,4), Q1(:,1:3)]; % tentar garantir [w x y z]
end
Q1 = Q1 ./ vecnorm(Q1,2,2);
% Vetor Z global ideal
z_ref = [0 0 1];
% Calcular rotação para alinhar g_est1 -> z_ref
v = cross(g_est1, z_ref);
s = norm(v);
if s ~= 0
c = dot(g_est1, z_ref);
v_skew = [0 -v(3) v(2); v(3) 0 -v(1); -v(2) v(1) 0];
R_align = eye(3) + v_skew + v_skew^2 * ((1 – c)/(s^2));
else
R_align = eye(3);
end
% Converter aceleração e alinhar
a1 = [T.a1x, T.a1y, T.a1z];
a1_gbl = quatrotate(Q1, a1);
a1_gbl_corr = (R_align * a1_gbl’)’;
% Remover gravidade
a1_free_gbl = a1_gbl_corr – [0 0 G];
(I apply the same procedure for IMU2 if present.)📎 Example of the issue
When visualizing the acceleration before and after gravity removal, the result still does not look physically correct, despite the 6-pose calibration and quaternion rotation.
Image 1: Before gravity removal
Image 2: After gravity removal — still incorrect)
❓ My Main Questions
Is my approach to rotate acceleration into the global frame and remove gravity mathematically correct?(Or am I applying the alignment/rotation in the wrong order?)
Should gravity be removed before or after applying R_align?Some posts suggest subtracting gravity in the sensor frame, others in global frame.
Quaternion convention:I’m assuming MATLAB’s quatrotate expects [w x y z] (scalar-first).Am I handling the quaternion conversion correctly here, or could this be a mismatch with the ICM-20948 library?
Given that I’m not using the magnetometer:For recordings of 30–120 s, is yaw drift likely to significantly affect gravity removal, or should it still work reasonably well?
Any help or guidance would be greatly appreciated — especially if someone spots a conceptual mistake or if there’s a more robust approach to handle gravity removal for this sensor.
Thanks in advance!Hi everyone,
I’m working on a project where I collect motion data using two ICM-20948 IMUs connected to an ESP32. I apply a 6-pose accelerometer calibration on the microcontroller and later process the data in MATLAB to obtain linear acceleration in the global frame (gravity-free). However, even after rotating the accelerometer data using the quaternions and subtracting gravity, the results still don’t look correct.
Before assuming my processing is wrong, I want to double-check with the community whether my MATLAB approach for gravity removal is correct — and whether I’m handling the quaternion convention properly.📍 Data Acquisition Pipeline (short summary)
Hardware: ESP32 + 2× ICM-20948
I use the ICM20948_WE library
On the ESP32 I:✅ Read accel & gyro✅ Apply bias + gain from 6-pose calibration✅ Log calibrated accel (in g), calibrated gyro, and quaternions
No magnetometer used (so yaw may drift, but recordings are 30–120 s only)
Data is saved as:
q0 q1 q2 q3 ax ay az gx gy gz
🧠 MATLAB Processing (core part of code)
Below is the section where I align the IMU with the global frame and remove gravity. I use the first ~5 s (static) to estimate the gravity direction, align the IMU Z-axis to global Z, rotate accel using the quaternions, and subtract gravity:
%% CORREÇÃO DA ORIENTAÇÃO INICIAL (PERÍODO PARADO)
fprintf(‘n— Correção da Orientação Inicial (5 s parado) —n’);
G = 9.80665; % m/s²
Fs_my = 1 / mean(diff(T.t_s));
Nrest = round(5 * Fs_my);
% IMU1
a1_rest = [T.a1x(1:Nrest), T.a1y(1:Nrest), T.a1z(1:Nrest)];
g_est1 = mean(a1_rest, 1);
g_est1 = g_est1 / norm(g_est1);
% direção da gravidade medida
% Quaternion inicial
Q1 = [T.q10, T.q11, T.q12, T.q13];
if mean(abs(Q1(:,1))) < mean(abs(Q1(:,4)))
Q1 = [Q1(:,4), Q1(:,1:3)]; % tentar garantir [w x y z]
end
Q1 = Q1 ./ vecnorm(Q1,2,2);
% Vetor Z global ideal
z_ref = [0 0 1];
% Calcular rotação para alinhar g_est1 -> z_ref
v = cross(g_est1, z_ref);
s = norm(v);
if s ~= 0
c = dot(g_est1, z_ref);
v_skew = [0 -v(3) v(2); v(3) 0 -v(1); -v(2) v(1) 0];
R_align = eye(3) + v_skew + v_skew^2 * ((1 – c)/(s^2));
else
R_align = eye(3);
end
% Converter aceleração e alinhar
a1 = [T.a1x, T.a1y, T.a1z];
a1_gbl = quatrotate(Q1, a1);
a1_gbl_corr = (R_align * a1_gbl’)’;
% Remover gravidade
a1_free_gbl = a1_gbl_corr – [0 0 G];
(I apply the same procedure for IMU2 if present.)📎 Example of the issue
When visualizing the acceleration before and after gravity removal, the result still does not look physically correct, despite the 6-pose calibration and quaternion rotation.
Image 1: Before gravity removal
Image 2: After gravity removal — still incorrect)
❓ My Main Questions
Is my approach to rotate acceleration into the global frame and remove gravity mathematically correct?(Or am I applying the alignment/rotation in the wrong order?)
Should gravity be removed before or after applying R_align?Some posts suggest subtracting gravity in the sensor frame, others in global frame.
Quaternion convention:I’m assuming MATLAB’s quatrotate expects [w x y z] (scalar-first).Am I handling the quaternion conversion correctly here, or could this be a mismatch with the ICM-20948 library?
Given that I’m not using the magnetometer:For recordings of 30–120 s, is yaw drift likely to significantly affect gravity removal, or should it still work reasonably well?
Any help or guidance would be greatly appreciated — especially if someone spots a conceptual mistake or if there’s a more robust approach to handle gravity removal for this sensor.
Thanks in advance! Hi everyone,
I’m working on a project where I collect motion data using two ICM-20948 IMUs connected to an ESP32. I apply a 6-pose accelerometer calibration on the microcontroller and later process the data in MATLAB to obtain linear acceleration in the global frame (gravity-free). However, even after rotating the accelerometer data using the quaternions and subtracting gravity, the results still don’t look correct.
Before assuming my processing is wrong, I want to double-check with the community whether my MATLAB approach for gravity removal is correct — and whether I’m handling the quaternion convention properly.📍 Data Acquisition Pipeline (short summary)
Hardware: ESP32 + 2× ICM-20948
I use the ICM20948_WE library
On the ESP32 I:✅ Read accel & gyro✅ Apply bias + gain from 6-pose calibration✅ Log calibrated accel (in g), calibrated gyro, and quaternions
No magnetometer used (so yaw may drift, but recordings are 30–120 s only)
Data is saved as:
q0 q1 q2 q3 ax ay az gx gy gz
🧠 MATLAB Processing (core part of code)
Below is the section where I align the IMU with the global frame and remove gravity. I use the first ~5 s (static) to estimate the gravity direction, align the IMU Z-axis to global Z, rotate accel using the quaternions, and subtract gravity:
%% CORREÇÃO DA ORIENTAÇÃO INICIAL (PERÍODO PARADO)
fprintf(‘n— Correção da Orientação Inicial (5 s parado) —n’);
G = 9.80665; % m/s²
Fs_my = 1 / mean(diff(T.t_s));
Nrest = round(5 * Fs_my);
% IMU1
a1_rest = [T.a1x(1:Nrest), T.a1y(1:Nrest), T.a1z(1:Nrest)];
g_est1 = mean(a1_rest, 1);
g_est1 = g_est1 / norm(g_est1);
% direção da gravidade medida
% Quaternion inicial
Q1 = [T.q10, T.q11, T.q12, T.q13];
if mean(abs(Q1(:,1))) < mean(abs(Q1(:,4)))
Q1 = [Q1(:,4), Q1(:,1:3)]; % tentar garantir [w x y z]
end
Q1 = Q1 ./ vecnorm(Q1,2,2);
% Vetor Z global ideal
z_ref = [0 0 1];
% Calcular rotação para alinhar g_est1 -> z_ref
v = cross(g_est1, z_ref);
s = norm(v);
if s ~= 0
c = dot(g_est1, z_ref);
v_skew = [0 -v(3) v(2); v(3) 0 -v(1); -v(2) v(1) 0];
R_align = eye(3) + v_skew + v_skew^2 * ((1 – c)/(s^2));
else
R_align = eye(3);
end
% Converter aceleração e alinhar
a1 = [T.a1x, T.a1y, T.a1z];
a1_gbl = quatrotate(Q1, a1);
a1_gbl_corr = (R_align * a1_gbl’)’;
% Remover gravidade
a1_free_gbl = a1_gbl_corr – [0 0 G];
(I apply the same procedure for IMU2 if present.)📎 Example of the issue
When visualizing the acceleration before and after gravity removal, the result still does not look physically correct, despite the 6-pose calibration and quaternion rotation.
Image 1: Before gravity removal
Image 2: After gravity removal — still incorrect)
❓ My Main Questions
Is my approach to rotate acceleration into the global frame and remove gravity mathematically correct?(Or am I applying the alignment/rotation in the wrong order?)
Should gravity be removed before or after applying R_align?Some posts suggest subtracting gravity in the sensor frame, others in global frame.
Quaternion convention:I’m assuming MATLAB’s quatrotate expects [w x y z] (scalar-first).Am I handling the quaternion conversion correctly here, or could this be a mismatch with the ICM-20948 library?
Given that I’m not using the magnetometer:For recordings of 30–120 s, is yaw drift likely to significantly affect gravity removal, or should it still work reasonably well?
Any help or guidance would be greatly appreciated — especially if someone spots a conceptual mistake or if there’s a more robust approach to handle gravity removal for this sensor.
Thanks in advance! imu, quaternions, preprocessing, acceleration, icm20948, esp32 MATLAB Answers — New Questions
What is the best practice to understand the source code of MATLAB’s built function ?
I want to learn the basic theory of wavelet synchrosqueezed transform, and find that there is a built-in function wsst in the Wavelet Toolbox. I open the wsst file using the dbtype wsst command so that the source code of the wsst is illustrated in the Command Window. However, I find that there are many complex function callls in the calculation process of wsst, it is difficult to get insight into the detailed calculation procedure of wsst. I would like to receive some useful advice from the mathworks community on how to better understand Matlab’s built-in complex functions, such as the aforementioned wsst function.I want to learn the basic theory of wavelet synchrosqueezed transform, and find that there is a built-in function wsst in the Wavelet Toolbox. I open the wsst file using the dbtype wsst command so that the source code of the wsst is illustrated in the Command Window. However, I find that there are many complex function callls in the calculation process of wsst, it is difficult to get insight into the detailed calculation procedure of wsst. I would like to receive some useful advice from the mathworks community on how to better understand Matlab’s built-in complex functions, such as the aforementioned wsst function. I want to learn the basic theory of wavelet synchrosqueezed transform, and find that there is a built-in function wsst in the Wavelet Toolbox. I open the wsst file using the dbtype wsst command so that the source code of the wsst is illustrated in the Command Window. However, I find that there are many complex function callls in the calculation process of wsst, it is difficult to get insight into the detailed calculation procedure of wsst. I would like to receive some useful advice from the mathworks community on how to better understand Matlab’s built-in complex functions, such as the aforementioned wsst function. wavelet, signal processing, matlab function MATLAB Answers — New Questions
When using noiseParameters functions, why do I have to set the impedance to 1 and not 50.
I have created a cascade of S-Parameter files using the RF Toolbox. When I use the noiseParameters function for the active elements to calculate the noise figure, I notice that to get a noise figure close to what I have calculated manually, I need to set the impedance to 1 Ohm.
However, I am certain that these S-Parameter files represent 50 Ohm systems. This discrepancy is concerning, and I would appreciate any insights or suggestions on how to resolve this issue.
Thank you!I have created a cascade of S-Parameter files using the RF Toolbox. When I use the noiseParameters function for the active elements to calculate the noise figure, I notice that to get a noise figure close to what I have calculated manually, I need to set the impedance to 1 Ohm.
However, I am certain that these S-Parameter files represent 50 Ohm systems. This discrepancy is concerning, and I would appreciate any insights or suggestions on how to resolve this issue.
Thank you! I have created a cascade of S-Parameter files using the RF Toolbox. When I use the noiseParameters function for the active elements to calculate the noise figure, I notice that to get a noise figure close to what I have calculated manually, I need to set the impedance to 1 Ohm.
However, I am certain that these S-Parameter files represent 50 Ohm systems. This discrepancy is concerning, and I would appreciate any insights or suggestions on how to resolve this issue.
Thank you! cascade, noiseparameters MATLAB Answers — New Questions
Quick substitution of all multi-objective optimization results (gamultiobj) into optimization expressions
I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?)I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?) I’m using problem-based optimization formulation for the first time (it’s great!) and I’ve been struggling a bit with how to interact seamlessly with the results. My optimization is multi-objective and the setup has the following characteristics:
Using problem-based optimization formulation, I’m defining many variables using optimvar (e.g., rho, D, W)
From there I’m defining objective and constraint functions as OptimizationExpression objects, e.g. V=pi*(D/2)^2*W, M=rho*V (simplified but still relevant to my actual problem)
In my case, minimizing volume V is one of the objectives, but M is a part of another objective as well as some constraints, so I would like to quickly evaluate the OptimizationExpression M over the optimization results (Pareto front) returned within sol and use it in some post-processing plots.
After much experimentation, I did find that I can substitute a particular result by index into an existing OptimizationExpression object using the following syntax:
ii=10; % Index of solution I’m interested in
solStruct=struct(sol(ii));
Mval=evaluate(M,solStruct.Values);
Obviously I can build a loop over ii to get an array Mval, but is there a way to do it more elegantly? (And am I using the intended method to evaluate a single solution from the optimization?) optimization, multi-objective optimization, gamultiobj, problem-based optimization MATLAB Answers — New Questions
Namespace not recognized when used in a function called from an app
I have an app that calls a function in an external file. The function references a class in a namespace directory (beginning with a +). I set up the paths in the app to include the namespace directory’s parent folder and not the namespace directory. When the app calls the function, the function generates a MATLAB:UndefinedFunction error that it cannot locate the namespace.class. When I debug I stop at the problematic line and can access the namespace as normal in the debug command line. I can execute the code of the line where the error occurs, but if I click continue in the debugger the code fails.
Simplified exemple code:
MyProject/
+MyNameSpace/
MyClass.m
MyApp.mlapp
MyFunction.m
startup.m
MyClass.m:
classdef MyClass
properties
value = 1;
end
end
MyFunction.m:
function value = MyFunction()
value = MyNameSpace.MyClass.value;
end
startup.m:
function startup
% Determine where your m-file’s folder is.
folder = fileparts(which(mfilename));
% Add that folder plus all subfolders to the path.
addpath(folder);
end
Then inside the MyApp.mlapp I use the startupFcn method that is called by the constructor to call startup.m:
function startupFcn(app)
startup
end
And a button callback to call MyFunction:
% Button pushed function: RunButton
function RunButtonPushed(app, event)
value = MyFunction();
end
The returned error states:
"Unrecognized function or variable ‘MyNameSpace’."I have an app that calls a function in an external file. The function references a class in a namespace directory (beginning with a +). I set up the paths in the app to include the namespace directory’s parent folder and not the namespace directory. When the app calls the function, the function generates a MATLAB:UndefinedFunction error that it cannot locate the namespace.class. When I debug I stop at the problematic line and can access the namespace as normal in the debug command line. I can execute the code of the line where the error occurs, but if I click continue in the debugger the code fails.
Simplified exemple code:
MyProject/
+MyNameSpace/
MyClass.m
MyApp.mlapp
MyFunction.m
startup.m
MyClass.m:
classdef MyClass
properties
value = 1;
end
end
MyFunction.m:
function value = MyFunction()
value = MyNameSpace.MyClass.value;
end
startup.m:
function startup
% Determine where your m-file’s folder is.
folder = fileparts(which(mfilename));
% Add that folder plus all subfolders to the path.
addpath(folder);
end
Then inside the MyApp.mlapp I use the startupFcn method that is called by the constructor to call startup.m:
function startupFcn(app)
startup
end
And a button callback to call MyFunction:
% Button pushed function: RunButton
function RunButtonPushed(app, event)
value = MyFunction();
end
The returned error states:
"Unrecognized function or variable ‘MyNameSpace’." I have an app that calls a function in an external file. The function references a class in a namespace directory (beginning with a +). I set up the paths in the app to include the namespace directory’s parent folder and not the namespace directory. When the app calls the function, the function generates a MATLAB:UndefinedFunction error that it cannot locate the namespace.class. When I debug I stop at the problematic line and can access the namespace as normal in the debug command line. I can execute the code of the line where the error occurs, but if I click continue in the debugger the code fails.
Simplified exemple code:
MyProject/
+MyNameSpace/
MyClass.m
MyApp.mlapp
MyFunction.m
startup.m
MyClass.m:
classdef MyClass
properties
value = 1;
end
end
MyFunction.m:
function value = MyFunction()
value = MyNameSpace.MyClass.value;
end
startup.m:
function startup
% Determine where your m-file’s folder is.
folder = fileparts(which(mfilename));
% Add that folder plus all subfolders to the path.
addpath(folder);
end
Then inside the MyApp.mlapp I use the startupFcn method that is called by the constructor to call startup.m:
function startupFcn(app)
startup
end
And a button callback to call MyFunction:
% Button pushed function: RunButton
function RunButtonPushed(app, event)
value = MyFunction();
end
The returned error states:
"Unrecognized function or variable ‘MyNameSpace’." app designer, namespaces, classes MATLAB Answers — New Questions
What am I supposed to put in magnetization inductance?
Hi,
I want to simulate this push-pull DC-DC converter in simulink:
I am modifying the magnetization inductance (Lm) for a value that is appropriate for my specs: Vin = 137.14 V (it comes from a previous stage),Vout = 350 V, D = 0.13, Iin = 7 A (approx.). I see that even if I set it in SI units, it says (pu) for the magnetization inductance. It confuses me because I was trying to have 1 mH or 10 mH to avoid an overvoltage and I don’t know in which units it’s actually. I was also trying with higher values of Lm but I have that peak at the beginning. In fact I have seen 2 situations.
A) Overvoltage, then stabilizes but the value was a few volts far from the reference. This is the case when magnetization inductance is 0.0.
B) Overvoltage, then starts dropping to 155 V.
Can someone tell me what are the expected values in the parameters of the transformer for such specs and in which units is calculating Lm when I set it in SI units?
Also, the input current has this aspect:
Thanks.
CarlosHi,
I want to simulate this push-pull DC-DC converter in simulink:
I am modifying the magnetization inductance (Lm) for a value that is appropriate for my specs: Vin = 137.14 V (it comes from a previous stage),Vout = 350 V, D = 0.13, Iin = 7 A (approx.). I see that even if I set it in SI units, it says (pu) for the magnetization inductance. It confuses me because I was trying to have 1 mH or 10 mH to avoid an overvoltage and I don’t know in which units it’s actually. I was also trying with higher values of Lm but I have that peak at the beginning. In fact I have seen 2 situations.
A) Overvoltage, then stabilizes but the value was a few volts far from the reference. This is the case when magnetization inductance is 0.0.
B) Overvoltage, then starts dropping to 155 V.
Can someone tell me what are the expected values in the parameters of the transformer for such specs and in which units is calculating Lm when I set it in SI units?
Also, the input current has this aspect:
Thanks.
Carlos Hi,
I want to simulate this push-pull DC-DC converter in simulink:
I am modifying the magnetization inductance (Lm) for a value that is appropriate for my specs: Vin = 137.14 V (it comes from a previous stage),Vout = 350 V, D = 0.13, Iin = 7 A (approx.). I see that even if I set it in SI units, it says (pu) for the magnetization inductance. It confuses me because I was trying to have 1 mH or 10 mH to avoid an overvoltage and I don’t know in which units it’s actually. I was also trying with higher values of Lm but I have that peak at the beginning. In fact I have seen 2 situations.
A) Overvoltage, then stabilizes but the value was a few volts far from the reference. This is the case when magnetization inductance is 0.0.
B) Overvoltage, then starts dropping to 155 V.
Can someone tell me what are the expected values in the parameters of the transformer for such specs and in which units is calculating Lm when I set it in SI units?
Also, the input current has this aspect:
Thanks.
Carlos push-pull, power_electronics_control, power_conversion_control, dc-dc converter, simulink MATLAB Answers — New Questions
Reporting the Use of Emojis in Teams Reactions
Find and Analyze How People Use Emojis as Teams Reactions
An interesting LinkedIn post expressed the opinion that it’s easier to learn some new technology by doing something fun with it. In this case, the author shows how to use KQL to interrogate Microsoft 365 audit data stored in Microsoft Sentinel to analyze the use of Teams emoji reactions for messages. Essentially, the idea is that if you can master KQL to query Sentinel data for emoji usage, you can do the same for more serious activities.
I decided that it would be a good idea to show how to do the same with PowerShell based on audit records from the unified audit log. The same data drives both repositories, so the same results should be achievable. I’ve added a little bit of extra value by showing how to display the emojis instead of just the emoji names, and I also report user display names instead of user principal names.
Teams Emojis
Teams offers a wide range of “fluent” emojis that people can use to react to chat and channel messages. Tenants can add their own custom emojis to the set provided by Microsoft. Up to twenty emojis can be used to react to a message. Basically, you can go wild with emojis should you like to react to messages in a blizzard of colorful emotions.
Audit events are captured when people use emojis to react to Teams chat and channel messages. Each emoji counts as a separate reaction, and each reaction is logged as a ReactedToMessage audit event.
Scripting the Emoji Analysis
The code in the script to analyze the use of emojis in Teams reactions is not very complex. Here’s what I did:
- Run Connect-MgGraph to connect to the Microsoft Graph PowerShell SDK to fetch details of user accounts (display names and user principal names). Because these are base properties, only the User.ReadBasic.All permission is needed. If you don’t want to see display names in the report, you don’t need this code.
- Run Connect-ExchangeOnline to connect to the Exchange Online management endpoint.
- Create a hash table and populate it with user principal names (keys) and display names (values). This data is used to translate the user principal names found in audit events into display names for the report.
- Create a hash table of emoji keyed on the emoji name and with the emoji graphics as the values. Microsoft doesn’t document the full set of Teams emojis, but I found this page useful. The hash table contains about 80 emojis from the full set. These are the emojis used in my tenant. Your tenant might differ, in which case you’ll need to add more key-value pairs to the hash table.
- Run the Search-UnifiedAuditLog cmdlet to find events with the ReactToMessage operation. If events are found, the script removes duplications (which can happen in audit results).
- Loop through the audit records and create a report of what’s found. The report includes instances where reactions are added or removed to chats or channel messages.
- Generate an Excel worksheet containing the data (if the ImportExcel module is not installed), the script creates a CSV file instead. Figure 1 shows some data extracted from my tenant.

The data can also be used for basis analysis. For instance, here’s how to find the count of the ten most used emojis, including the emoji fetched from the hash table:
Write-Output "Top Ten Emoji reactions used in Teams"
$Report | Group-Object Reaction -NoElement | Sort-Object Count -Descending | Select-Object -First 10 | Format-Table Name, @{name="Emoji"; Expression = { $Emojis[$_.Name] }}, Count -AutoSize
Top Ten Emoji reactions used in Teams
Name Emoji Count
---- ----- -----
like
334
heart
109
laugh
31
surprised
26
yes-tone1
18
1f4af_hundredpointssymbol
8
like (Removed) 8
follow
7
handsinair
7
fire
7
And here’s how to find the top 10 emoji users:
$Report | Group-Object User -NoElement | Sort-Object Count -Descending | Select-Object -First 10 | Format-Table Name, Count Name Count ---- ----- Paul Robichaux | Keepit 122 Christina Wheeler 112 Tony Redmond 96 Tony Sterling (Teams) 67 Leah Theil | Keepit 61 Juan Carlos González Martín 44 Michel de Rooij (MVP) 41 Leah Theil 31 Ben Lee 18 Sean Landy (Office 365 for IT Pros) 11
A Learning Exercise
I doubt if the script (which you can download from the Office 365 for IT Pros repository) has any great business value. But learning how to access data in the unified audit log is a core skill for a Microsoft 365 tenant administrator. Being able to manipulate the audit data with PowerShell makes the data more powerful, and that’s why we learn how to do these things.
Support the work of the Office 365 for IT Pros team by subscribing to the Office 365 for IT Pros eBook. Your support pays for the time we need to track, analyze, and document the changing world of Microsoft 365 and Office 365. Only humans contribute to our work!
radar IWR6843ISK
Hello, we have IWR6843ISK, MMWAVEICBOOST and DCA1000EVM cards for a school project. We have seen some applications in Matlable, but we couldn’t fully understand them. We want to get raw data from the radar and process it. We are thinking of using this data to perform SAR or object identification. Can anyone with information on this subject or sample code help us?Hello, we have IWR6843ISK, MMWAVEICBOOST and DCA1000EVM cards for a school project. We have seen some applications in Matlable, but we couldn’t fully understand them. We want to get raw data from the radar and process it. We are thinking of using this data to perform SAR or object identification. Can anyone with information on this subject or sample code help us? Hello, we have IWR6843ISK, MMWAVEICBOOST and DCA1000EVM cards for a school project. We have seen some applications in Matlable, but we couldn’t fully understand them. We want to get raw data from the radar and process it. We are thinking of using this data to perform SAR or object identification. Can anyone with information on this subject or sample code help us? radar, matlab, iwr6843isk MATLAB Answers — New Questions
LDPC generator matrix G
Dear Forum
In the MATLAB examples the LDPC generator matrix G for AR4JA length 1024 rate 4/5 is size 32 x 256.
There is any way to convert this to the quasi cycle matrix H 1024 x 1280 ? OR in the prototype matrix P so i can use ‘ldpcQuasiCycleMatrix’ function ?
Thank you
AndreiDear Forum
In the MATLAB examples the LDPC generator matrix G for AR4JA length 1024 rate 4/5 is size 32 x 256.
There is any way to convert this to the quasi cycle matrix H 1024 x 1280 ? OR in the prototype matrix P so i can use ‘ldpcQuasiCycleMatrix’ function ?
Thank you
Andrei Dear Forum
In the MATLAB examples the LDPC generator matrix G for AR4JA length 1024 rate 4/5 is size 32 x 256.
There is any way to convert this to the quasi cycle matrix H 1024 x 1280 ? OR in the prototype matrix P so i can use ‘ldpcQuasiCycleMatrix’ function ?
Thank you
Andrei transferred MATLAB Answers — New Questions
fixdt outof bounds error for data conversion block
An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error.An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error. An error occurred during simulation and the simulation was terminated
Caused by:
Input value of block ‘dvbs2hdlLDPCEncoder/DVB-S2 LDPC Encoder/Parity Address Generator/ramLUT1’ exceeds range of breakpoint vector for dimension 2.
my fixdt(0,4,0) for conversion block is camped to 13 matching the maximum column dimension of my ramLUT 2-D. Still it throws me this error. fixed-point, simulink, convert MATLAB Answers — New Questions
How to connect a Basler camera to MATLAB
Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated.Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated. Hi everyone,
I have a Basler acA1920-155um that I am trying to connect to MATLAB using USB 3.0. This has proven more difficult than anticipated.
I’ve followed this (outdated) guide:
https://www2.baslerweb.com/media/downloads/documents/application_notes/AW00134303000_Application_Note_Basler_pylon_GenTL_Producers_with_….pdf
My understanding of what should happen is this:
1. Install the current version of the Basler Pylon Software Suite
2. Install the Image Acquisition toolbox
3. Download the GenTL support package via MATLAB
and….it should work. I open the image acquisition app in MATLAB and it does not find any cameras. I checked using imacqhwinfo and it does show that the GenTL diver is present, but no devices.
What I’ve tried:
I’ve attempted to download the Pylon SDK, and the GenTL drivers to replace them, to no avail.
The camera runs fine in Basler Pylon Viewer so I know it’s not a physical connection problem.
Any guidance is appreciated. basler, cameras, hardware, image acquisition, gentl, image processing, digital image processing MATLAB Answers — New Questions
rmpath does not remove folders on path
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity >> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> rmpath(‘/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1’);
Warning: "/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1" not found in path.
> In rmpath>doRemoveFromPath (line 102)
In rmpath (line 59)
>> doc rmpath
>> path
MATLABPATH %%% matlabCP1 manifestly remains on path
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/turbulence/CP1
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/io
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/skyrmions
/Users/siggia/Dropbox @RU Dropbox/Eric Siggia/Desktop/claude/matlabCP1/models/velocity rmpath MATLAB Answers — New Questions
Version 1.5 of the Microsoft 365 User Password and Authentication Report
Microsoft Adds Last Used Property for Authentication Methods
The Microsoft 365 User Password and Authentication report is one of the scripts that I pay attention to and attempt to keep up to date as new developments emerge. The last version (V1.4) dealt with a change in how the default MFA method is reported; the version before added details of the authentication methods configured for user accounts.
Now it’s time to go back to refresh the script again because Microsoft has refreshed the beta version of the list authentication methods API to add a last used date time property. Entra ID updates the property when the authentication method (SMS code, passkey, Microsoft authenticator app, and so on) is used to authenticate an account. Looking at the dates in my tenant, I see last used dates going back to January 2023. There might be earlier dates than this noted for some authentication methods, but the point is that this information is now available.
The Value of the Last Used Property
The value of the last used property is that if you know what authentication methods are in active use, you might be able to remove unused authentication methods from user accounts to reduce the available attack surface for those accounts.
In any case, knowing when authentication methods are in active use for accounts is good information to have, especially if you want to encourage (“nag”) people to move away from weak secondary authentication methods like SMS and use something stronger, like the authenticator app or passkeys.
Updating the Script to V1.5
In any case, it was time to break out Visual Studio Code to update the Microsoft 365 User Password and Authentication script. The code uses the Get-MgUserAuthenticationMethod cmdlet to fetch authentication methods for an account. Each method has an identifier, and the more interesting information is found in the additionalProperties property (array). You’ll need at least the UserAuthMethod-MicrosoftAuthApp.Read.All Graph permission to access this information:
[array]$AuthMethods = Get-MgUserAuthenticationMethod -UserId $User.Id -ErrorAction Stop $AuthMethods Id -- 28c10230-6103-485e-b985-444c60001490 3ddfcfc8-9383-446f-83cc-3ab9be4be18f 338e704e-bb5c-4b0d-9c2e-458e630e4017
Microsoft updated the Microsoft Graph PowerShell SDK to V2.32 earlier this month. So far, the release has proven stable, and I haven’t run into new problems. It includes the Get-MgBetaUserAuthenticationMethod cmdlet, which returns the last used property:
[array]$AuthMethods = Get-MgBetaUserAuthenticationMethod -UserId $User.Id -ErrorAction Stop $AuthMethods Id CreatedDateTime LastUsedDateTime -- --------------- ---------------- 28c10230-6103-485e-b985-444c60001490 30/05/2020 07:48:05 3ddfcfc8-9383-446f-83cc-3ab9be4be18f 338e704e-bb5c-4b0d-9c2e-458e630e4017 04/08/2025 06:27:29
Not all authentication methods update the created date and last used date properties, but enough do to make the properties worthwhile.
The interesting thing here is that the cmdlet now surfaces the created date time as a property instead of an item in the additionalProperties array. This change is likely due to an update to the underlying Graph API metadata, and it could result in some scripts breaking if, as expected, the change makes it through to production. I certainly had to make some code changes to accommodate the change in how the created date is exposed. Figure 1 shows some example output where the last used date is reported for two authentication methods.

It would be nice if the data provided for every authentication method was consistent, but it’s not. It’s just another challenge to solve when working with Graph data.
New Version Available from GitHub
The updated (V1.5) version of the script can be downloaded from the Office 365 for IT Pros GitHub repository. I make no claim of greatness for the code. It’s there for people to learn about how to access and use the Graph to interact with authentication methods. No doubt this will interest some and not others. Feel free to upgrade and enhance the code to meet your requirements.
Learn about managing Entra ID and the rest of the Microsoft 365 ecosystem by subscribing to the Office 365 for IT Pros eBook. Use our experience to understand what’s important and how best to protect your tenant.
Beware of double agents: How AI can fortify — or fracture — your cybersecurity
AI is rapidly becoming the backbone of our world, promising unprecedented productivity and innovation. But as organizations deploy AI agents to unlock new opportunities and drive growth, they also face a new breed of cybersecurity threats.
There are a lot of Star Trek fans here at Microsoft, including me. One of our engineering leaders gifted me a life-size cardboard standee of Data that lurks next to my office door. So, as I look at that cutout, I think about the Great AI Security Dilemma: Is AI going to be our best friend or our worst nightmare? Drawing inspiration from the duality of the android officer Data, and his evil twin Lore in the Star Trek universe, today’s AI agents can either fortify your cybersecurity defenses — or, if mismanaged — fracture them.
The influx of agents is real. IDC research[1] predicts there will be 1.3 billion agents in circulation by 2028. When we think about our agentic future in AI, the duality of Data and Lore seems like a great way to think about what we’ll face with AI agents and how to avoid double agents that upend control and trust. Leaders should consider three principles and tailor them to fit the specific needs of their organizations.
1. Recognize the new attack landscape
Security is not just an IT issue — it’s a board-level priority. Unlike traditional software, AI agents are even more dynamic, adaptive and likely to operate autonomously. This creates unique risks.
We must accept that AI can be abused in ways beyond what we’ve experienced with traditional software. We employ AI agents to perform well-meaning tasks, but those with broad privileges can be manipulated by bad actors to misuse their access, such as leaking sensitive data via automated actions. We call this the “Confused Deputy” problem. AI Agents “think” in terms of natural language where instructions and data are tightly intertwined, much more than in typical software we interact with. The generative models agents depend on dynamically analyze the entire soup of human (or even non-human) languages, making it hard to distinguish well-known safe operations from new instructions introduced through malicious manipulation. The risk grows even more when shadow agents — unapproved or orphaned — enter the picture. And as we saw in Bring Your Own Device (BYOD) and other tech waves, anything you cannot inventory and account for magnifies blind spots and drives risk ever upward.
2. Practice Agentic Zero Trust
AI agents may be new as productivity drivers, but they can still be managed effectively using established security principles. I’ve had great conversations about this here at Microsoft with leaders like Mustafa Suleyman, cofounder of DeepMind and now Executive Vice President and CEO of Microsoft AI. Mustafa frequently shares a way to think about this, which he outlined in his book The Coming Wave, in terms of Containment and Alignment.
Containment simply means we do not blindly trust our AI Agents, and we significantly box every aspect of what they do. For example, we cannot let any agent’s access privileges exceed its role and purpose — it’s the same security approach we take to employee accounts, software and devices, what we refer to as “least privilege.” Similarly, we contain by never implicitly trusting what an agent does or how it communicates — everything must be monitored — and when this isn’t possible, agents simply are not permitted to operate in our environment.
Alignment is all about infusing positive control of an AI agent’s intended purpose, through its prompts and the models it uses. We must only use AI agents trained to resist attempts at corruption, with standard and mission-specific safety protections built into both the model itself and the prompts used to invoke the model. AI agents must resist attempts to divert them from their approved uses. They must execute in a Containment environment that watches closely for deviation from their intended purpose. All this requires strong AI agent identity and clear accountable ownership within the organization. As part of AI governance, every agent must have an identity, and we must know who in the organization is accountable for its aligned behavior.
Containment (least privilege) and Alignment will sound familiar to enterprise security teams, because they align with some of the basic principles of Zero Trust. Agentic Zero Trust includes “assuming breach,” or never implicitly trusting anything, making humans, devices and agents verify who they are explicitly before they gain access and limiting their access to only what’s needed to perform a task. While Agentic Zero Trust ultimately includes deeper security capabilities, discussing Containment and Alignment is a good shorthand in security-in-AI strategy conversations with senior stakeholders to keep everyone grounded in managing the new risk. Agents will keep joining and adapting at work — some may become double agents. With proper controls, we can protect ourselves.
3. Foster a culture of secure innovation
Technology alone won’t solve AI security. Culture is the real superpower in managing cyber risk — and leaders have the unique ability to shape it. Start with open dialogue: make AI risks and responsible use part of everyday conversations. Keep it cross-functional: legal, compliance, HR and others should have a seat at the table. Invest in continuous education: train teams on AI security fundamentals and clarify policies to cut through noise. Finally, embrace safe experimentation: give people approved spaces to learn and innovate without creating risk.
Organizations that thrive will treat AI as a teammate, not a threat — building trust through communication, learning and continuous improvement.
The path forward: What every company should do
AI isn’t just another chapter — it’s a plot twist that changes everything. The opportunities are huge, but so are the risks. The rise of AI requires ambient security, which executives create by making cybersecurity a daily priority. This means blending robust technical measures with ongoing education and clear leadership so that security awareness influences every choice made. Organizations maintain ambient security when they:
- Make AI security a strategic priority.
- Insist on Containment and Alignment for every agent.
- Mandate identity, ownership and data governance.
- Build a culture that champions secure innovation.
And it will be important to take a set of practical steps:
- Assign every AI agent an ID and owner — just like employees need badges. This ensures traceability and control.
- Document each agent’s intent and scope.
- Monitor actions, inputs and outputs. Map data flows early to set compliance benchmarks.
- Keep agents in secure, sanctioned environments — no rogue “agent factories.”
The call to action for every business is: Review your AI governance framework now. Demand clarity, accountability and continuous improvement. The future of cybersecurity is human plus machine — lead with purpose and make AI your strongest ally.
At Microsoft, we know we have a huge role to play in empowering our customers in this new era. In May, we introduced Microsoft Entra Agent ID as a way to help customers place unique identities to agents from the moment they are created in Microsoft Copilot Studio and Azure AI Foundry. We leverage AI in Defender and Security Copilot, combined with the massive security signals we collect, to expose and defeat phishing campaigns and other attacks that cybercriminals may use as entry points to compromise AI agents. We’ve also been committed to a platform approach with AI agents, to help customers safely use both Microsoft and third-party agents on their journey, avoiding complexity and risk that come from needing to juggle excessive dashboards and management consoles.
I’m excited by several other innovations we will be sharing at Microsoft Ignite later this month, alongside customers and partners.
We may not be conversing with Data on the bridge of the USS Enterprise quite yet, but as a technologist, it’s never been more exciting than watching this stage of AI’s trajectory in our workplaces and lives. As leaders, understanding the core opportunities and risks helps create a safer world for humans and agents working together.
Notes
[1] IDC Info Snapshot, sponsored by Microsoft, 1.3 Billion AI Agents by 2028, May 2025 #US53361825
The post Beware of double agents: How AI can fortify — or fracture — your cybersecurity appeared first on The Official Microsoft Blog.
AI is rapidly becoming the backbone of our world, promising unprecedented productivity and innovation. But as organizations deploy AI agents to unlock new opportunities and drive growth, they also face a new breed of cybersecurity threats. There are a lot of Star Trek fans here at Microsoft, including me. One of our engineering leaders gifted…
The post Beware of double agents: How AI can fortify — or fracture — your cybersecurity appeared first on The Official Microsoft Blog.Read More
TDMS. data file conversion to csv. file
Hello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advanceHello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advance Hello Matlab users,
Can anyone please help me to convert my multiple tdms file in csv format?
Thank you in advance tdms, csv, signal, conversion, mathematics MATLAB Answers — New Questions
HDL Coder Error when converting AXI4 interface with different data rates
I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help.I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help. I’m having trouble understanding this error from HDL coder:
Failed All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port "data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
Error using hdlturnkey.data.Channel/validateCodeGenPortRate
All the DUT ports connecting to the "f2h_sdram0 Read" interface must be running at the fastest rate in the generated DUT HDL code. Port
"data_in" uses sample rate of 5e-06, the fastest rate in the DUT HDL code is 2e-07.
I want to read from a particular address in memory every 5 us. I don’t want to read every 2e-7 seconds and flood the bus with uneeded read requests. I tried checking the timing legend and nothing even seems to be running at 2e-07 so i’m not sure where it is getting that rate from in the first place.
Am i approaching the sampling logic for this incorrectly? Instead of controlling when it performs a read by changing the execution time of the read-slave-to-master interface and Data signals, should i let the execution time be set to -1 (inherited) and control the read time by changing the rd_dvalid signal using temporal logic in my stateflow chart? Thanks for any help. hdl coder MATLAB Answers — New Questions
Impossible to install the latest version of Matlab Connector on a Linux computer
I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue?I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue? I have installed the latest version of 2025b on a Linux system with Ubuntu 24.04.2 LTS.
It is not possible to install the Matlab connector (2025.11.0.2). The process is terminated and the following error is thrown:
Gtk-Message: 11:08:08.425: Failed to load module "gail"
Gtk-Message: 11:08:08.425: Failed to load module "atk-bridge"
I have never had any issues with the Connector whatsoever in the past. Following suggestions from the helpdesk, I did several things already: installing from a different folder, bypassing the firewall, disabling the router, install but not as superuser, fresh Matlab install, etc. It seems the installer completes extraction but fails to start services.
I am very much dependent on the Connector and it is very frustrating that 2025b & Connector do not work out-of-the-box. Furthermore, the process of troubleshooting has become beyond my expertise. What steps can I take to make it work? Is there a way to generate a log or something that can be used to understand the issue? matlab connector MATLAB Answers — New Questions


334
heart
109
laugh
31
surprised
26
yes-tone1
18
1f4af_hundredpointssymbol
8
like (Removed) 8
follow
7
handsinair
7
fire
7







