Category: News
Is this Application of Leibniz Rule in Symbolic Math Toolbox Incorrect?
Referring to Leibniz Integral Rule:
Verify R2025b
matlabRelease
Define some functions
syms t x
syms f_1(x) f_2(x) g(t)
Case 1 looks correct:
syms G(x)
eqn1 = G(x) == int(g(t),t,f_1(x),f_2(x));
eqn2 = diff(eqn1,x);
case1 = [eqn1;eqn2]
Case 2 looks correct. Same as case 1 with dg(t)/dt replacing g(t).
Dg(t) = diff(g(t),t);
eqn3 = G(x) == int(Dg(t),t,f_1(x),f_2(x));
eqn4 = diff(eqn3,x);
case2 = [eqn3;eqn4]
Case 3 looks correct. Same as case 1 with g(t) = h(t)p(t)
syms h(t) p(t)
eqn5 = G(x) == int(h(t)*p(t),t,f_1(x),f_2(x));
eqn6 = diff(eqn5,x);
case3 = [eqn5;eqn6]
Case 4 looks incorrect
Dp(t) = diff(p(t),t);
eqn7 = G(x) == int(h(t)*Dp(t),t,f_1(x),f_2(x));
eqn8 = diff(eqn7,x);
case4 = [eqn7;eqn8]
I don’t understand the meaning of the third multiplicands in both terms of the derivative expression. What does it mean to differentiate with respect to a function?
Seems like case 4 should be:
eqn9 = diff(G(x),x) == h(f_2(x))*Dp(f_2(x))*diff(f_2(x),x) – h(f_1(x))*Dp(f_1(x))*diff(f_1(x),x)
Is case 4 (eqn8) incorrect or am I misunderstanding the mathematical meaning of
diff(p(f_2(x)),f_2(x))Referring to Leibniz Integral Rule:
Verify R2025b
matlabRelease
Define some functions
syms t x
syms f_1(x) f_2(x) g(t)
Case 1 looks correct:
syms G(x)
eqn1 = G(x) == int(g(t),t,f_1(x),f_2(x));
eqn2 = diff(eqn1,x);
case1 = [eqn1;eqn2]
Case 2 looks correct. Same as case 1 with dg(t)/dt replacing g(t).
Dg(t) = diff(g(t),t);
eqn3 = G(x) == int(Dg(t),t,f_1(x),f_2(x));
eqn4 = diff(eqn3,x);
case2 = [eqn3;eqn4]
Case 3 looks correct. Same as case 1 with g(t) = h(t)p(t)
syms h(t) p(t)
eqn5 = G(x) == int(h(t)*p(t),t,f_1(x),f_2(x));
eqn6 = diff(eqn5,x);
case3 = [eqn5;eqn6]
Case 4 looks incorrect
Dp(t) = diff(p(t),t);
eqn7 = G(x) == int(h(t)*Dp(t),t,f_1(x),f_2(x));
eqn8 = diff(eqn7,x);
case4 = [eqn7;eqn8]
I don’t understand the meaning of the third multiplicands in both terms of the derivative expression. What does it mean to differentiate with respect to a function?
Seems like case 4 should be:
eqn9 = diff(G(x),x) == h(f_2(x))*Dp(f_2(x))*diff(f_2(x),x) – h(f_1(x))*Dp(f_1(x))*diff(f_1(x),x)
Is case 4 (eqn8) incorrect or am I misunderstanding the mathematical meaning of
diff(p(f_2(x)),f_2(x)) Referring to Leibniz Integral Rule:
Verify R2025b
matlabRelease
Define some functions
syms t x
syms f_1(x) f_2(x) g(t)
Case 1 looks correct:
syms G(x)
eqn1 = G(x) == int(g(t),t,f_1(x),f_2(x));
eqn2 = diff(eqn1,x);
case1 = [eqn1;eqn2]
Case 2 looks correct. Same as case 1 with dg(t)/dt replacing g(t).
Dg(t) = diff(g(t),t);
eqn3 = G(x) == int(Dg(t),t,f_1(x),f_2(x));
eqn4 = diff(eqn3,x);
case2 = [eqn3;eqn4]
Case 3 looks correct. Same as case 1 with g(t) = h(t)p(t)
syms h(t) p(t)
eqn5 = G(x) == int(h(t)*p(t),t,f_1(x),f_2(x));
eqn6 = diff(eqn5,x);
case3 = [eqn5;eqn6]
Case 4 looks incorrect
Dp(t) = diff(p(t),t);
eqn7 = G(x) == int(h(t)*Dp(t),t,f_1(x),f_2(x));
eqn8 = diff(eqn7,x);
case4 = [eqn7;eqn8]
I don’t understand the meaning of the third multiplicands in both terms of the derivative expression. What does it mean to differentiate with respect to a function?
Seems like case 4 should be:
eqn9 = diff(G(x),x) == h(f_2(x))*Dp(f_2(x))*diff(f_2(x),x) – h(f_1(x))*Dp(f_1(x))*diff(f_1(x),x)
Is case 4 (eqn8) incorrect or am I misunderstanding the mathematical meaning of
diff(p(f_2(x)),f_2(x)) leibniz rule MATLAB Answers — New Questions
Perfusionist nurse trying to lear fluids mechanics
Hello everyone;
I am an Spanish nurse studying a postdegree of Extracorporeal Circulation on Cardiac Surgery and now we are studying phisiology and fluids mechanics and i discorver my university has license with matlab and i would like to learn about my field simulating on this software. Anyone has any tip how start, if vaible simulate an oxiygen membrane etc
Thank you everybody.Hello everyone;
I am an Spanish nurse studying a postdegree of Extracorporeal Circulation on Cardiac Surgery and now we are studying phisiology and fluids mechanics and i discorver my university has license with matlab and i would like to learn about my field simulating on this software. Anyone has any tip how start, if vaible simulate an oxiygen membrane etc
Thank you everybody. Hello everyone;
I am an Spanish nurse studying a postdegree of Extracorporeal Circulation on Cardiac Surgery and now we are studying phisiology and fluids mechanics and i discorver my university has license with matlab and i would like to learn about my field simulating on this software. Anyone has any tip how start, if vaible simulate an oxiygen membrane etc
Thank you everybody. medicine MATLAB Answers — New Questions
interp1() returns a plot with empty sections
I am trying to use the interp1() function to first, plot a continuous graph between a variable and time. Then I want to use the plot to look up the value of the variable at every instant. However, my plot appears to have empty sections, which is probably why I get NaN errors in my calculations. I attached my excel file also.
grade_data = readmatrix(‘grade.xlsx’); % reads the excel file
t_grade_raw = grade_data(:, 1)’; % Extract Time (transpose to row vector)
grade_raw = grade_data(:, 2)’; % Extract Grade (transpose to row vector)
% Interpolating to plot
grade_interp = interp1(t_grade_raw, grade_raw, t, ‘linear’);
% Safety: Replace any remaining NaNs with 0
grade_interp(isnan(grade_interp)) = 0;
% Graphing
plot(t, grade_interp, ‘r-‘, ‘LineWidth’, 1.5);I am trying to use the interp1() function to first, plot a continuous graph between a variable and time. Then I want to use the plot to look up the value of the variable at every instant. However, my plot appears to have empty sections, which is probably why I get NaN errors in my calculations. I attached my excel file also.
grade_data = readmatrix(‘grade.xlsx’); % reads the excel file
t_grade_raw = grade_data(:, 1)’; % Extract Time (transpose to row vector)
grade_raw = grade_data(:, 2)’; % Extract Grade (transpose to row vector)
% Interpolating to plot
grade_interp = interp1(t_grade_raw, grade_raw, t, ‘linear’);
% Safety: Replace any remaining NaNs with 0
grade_interp(isnan(grade_interp)) = 0;
% Graphing
plot(t, grade_interp, ‘r-‘, ‘LineWidth’, 1.5); I am trying to use the interp1() function to first, plot a continuous graph between a variable and time. Then I want to use the plot to look up the value of the variable at every instant. However, my plot appears to have empty sections, which is probably why I get NaN errors in my calculations. I attached my excel file also.
grade_data = readmatrix(‘grade.xlsx’); % reads the excel file
t_grade_raw = grade_data(:, 1)’; % Extract Time (transpose to row vector)
grade_raw = grade_data(:, 2)’; % Extract Grade (transpose to row vector)
% Interpolating to plot
grade_interp = interp1(t_grade_raw, grade_raw, t, ‘linear’);
% Safety: Replace any remaining NaNs with 0
grade_interp(isnan(grade_interp)) = 0;
% Graphing
plot(t, grade_interp, ‘r-‘, ‘LineWidth’, 1.5); interpolation MATLAB Answers — New Questions
Automated Driving Toolbox 3D simulation on Macbook Air M4
Hey guys!
I just purchased a Macbook Air M4 because i needed it for my dissertation and it turns out it won’t run Unreal Engine powered 3D simulations. I’m working on Automated Driving Toolbox in Simulink and I run radar and camera powered assist systems like Front Assist, Lane Assist and Adaptive Cruise Control, and now I need to start working on V2X comms. I’m now on the fence because I feel like I have to return my Macbook even though i clearly dont want to because i love it but I have no choice if i cant do my work on it.
Do you guys now of any solutions? Matlab Online won’t work due to the sheer size of my project and it just takes forever to run.
Thank you!Hey guys!
I just purchased a Macbook Air M4 because i needed it for my dissertation and it turns out it won’t run Unreal Engine powered 3D simulations. I’m working on Automated Driving Toolbox in Simulink and I run radar and camera powered assist systems like Front Assist, Lane Assist and Adaptive Cruise Control, and now I need to start working on V2X comms. I’m now on the fence because I feel like I have to return my Macbook even though i clearly dont want to because i love it but I have no choice if i cant do my work on it.
Do you guys now of any solutions? Matlab Online won’t work due to the sheer size of my project and it just takes forever to run.
Thank you! Hey guys!
I just purchased a Macbook Air M4 because i needed it for my dissertation and it turns out it won’t run Unreal Engine powered 3D simulations. I’m working on Automated Driving Toolbox in Simulink and I run radar and camera powered assist systems like Front Assist, Lane Assist and Adaptive Cruise Control, and now I need to start working on V2X comms. I’m now on the fence because I feel like I have to return my Macbook even though i clearly dont want to because i love it but I have no choice if i cant do my work on it.
Do you guys now of any solutions? Matlab Online won’t work due to the sheer size of my project and it just takes forever to run.
Thank you! 3d, simulation, macbook, unreal, engine, matlab, simulink, automated, driving, toolbox MATLAB Answers — New Questions
AMD vs Intel and Single-Core vs Multi-core CPU Performance Selection for Simulink Speed
I’m a grad student who frequently does power electronics simulations in Simulink. I am thinking of getting a new PC with 32 GB RAM (5600 MHz) and need to select the CPU. I’ve stumbled upon supposedly good options, such as the Intel i9-14900K (or i7-14700F if I go for significantly cheaper), and the AMD Ryzen 7 9800X3D. Which will be faster for Simulink simulations? Does the fact that the i9 has 24 cores vs the Ryzen 7’s 8 cores make a big difference, or is Simulink, by default, bottlenecked by single-core performance?
I read that the Ryzen 7 9800X3D has higher single-core performance, but the i9-14900K will have better multicore performance and is favourable if I ran multiple simulations at once or used parallel computing. However, the parallel computing toolbox seems difficult to use, so I don’t know if I’d like to amend all of my simulation practices to adhere to it.
Please don’t suggest making my simulations different or optimized; I understand that that will make a great difference in simulation speed. Also, I’m sorry if my lack of computer hardware knowledge is showing!I’m a grad student who frequently does power electronics simulations in Simulink. I am thinking of getting a new PC with 32 GB RAM (5600 MHz) and need to select the CPU. I’ve stumbled upon supposedly good options, such as the Intel i9-14900K (or i7-14700F if I go for significantly cheaper), and the AMD Ryzen 7 9800X3D. Which will be faster for Simulink simulations? Does the fact that the i9 has 24 cores vs the Ryzen 7’s 8 cores make a big difference, or is Simulink, by default, bottlenecked by single-core performance?
I read that the Ryzen 7 9800X3D has higher single-core performance, but the i9-14900K will have better multicore performance and is favourable if I ran multiple simulations at once or used parallel computing. However, the parallel computing toolbox seems difficult to use, so I don’t know if I’d like to amend all of my simulation practices to adhere to it.
Please don’t suggest making my simulations different or optimized; I understand that that will make a great difference in simulation speed. Also, I’m sorry if my lack of computer hardware knowledge is showing! I’m a grad student who frequently does power electronics simulations in Simulink. I am thinking of getting a new PC with 32 GB RAM (5600 MHz) and need to select the CPU. I’ve stumbled upon supposedly good options, such as the Intel i9-14900K (or i7-14700F if I go for significantly cheaper), and the AMD Ryzen 7 9800X3D. Which will be faster for Simulink simulations? Does the fact that the i9 has 24 cores vs the Ryzen 7’s 8 cores make a big difference, or is Simulink, by default, bottlenecked by single-core performance?
I read that the Ryzen 7 9800X3D has higher single-core performance, but the i9-14900K will have better multicore performance and is favourable if I ran multiple simulations at once or used parallel computing. However, the parallel computing toolbox seems difficult to use, so I don’t know if I’d like to amend all of my simulation practices to adhere to it.
Please don’t suggest making my simulations different or optimized; I understand that that will make a great difference in simulation speed. Also, I’m sorry if my lack of computer hardware knowledge is showing! simulink, speed MATLAB Answers — New Questions
Can I create an alias for timetable signals viewed with Signal Analyzer in Signal Processing Toolbox R2025b?
I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"?I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"? I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"? signalanalyzer, shortname, timetable, timeseries MATLAB Answers — New Questions
How to move a 3D volume in 6D (3 Translations and 3 Rotations)
Hello everyone,
I am simulating a CT volume that includes a couple of different structures using the "createSyntheticSkullCT" function. After that, I generate X-ray projections from the CT volume.
My goal is to move this CT volume in 6D, which includes translation in millimeters (X, Y, Z) and rotation in degrees (roll, pitch, yaw). To achieve this, I defined a function called "applyRigidTransform3D" in code 1 and "rigidTransform6D" in code 2 for the 6D movements, but I am not sure if this function is working correctly.
I would greatly appreciate any insights or suggestions regarding this code. Is my simulation realistic? If not, which parts contain errors? I would also welcome any recommended validation or sanity checks.
I have attached the MATLAB codes (Code1.m and Code2.m) below for reference.
Thank you!Hello everyone,
I am simulating a CT volume that includes a couple of different structures using the "createSyntheticSkullCT" function. After that, I generate X-ray projections from the CT volume.
My goal is to move this CT volume in 6D, which includes translation in millimeters (X, Y, Z) and rotation in degrees (roll, pitch, yaw). To achieve this, I defined a function called "applyRigidTransform3D" in code 1 and "rigidTransform6D" in code 2 for the 6D movements, but I am not sure if this function is working correctly.
I would greatly appreciate any insights or suggestions regarding this code. Is my simulation realistic? If not, which parts contain errors? I would also welcome any recommended validation or sanity checks.
I have attached the MATLAB codes (Code1.m and Code2.m) below for reference.
Thank you! Hello everyone,
I am simulating a CT volume that includes a couple of different structures using the "createSyntheticSkullCT" function. After that, I generate X-ray projections from the CT volume.
My goal is to move this CT volume in 6D, which includes translation in millimeters (X, Y, Z) and rotation in degrees (roll, pitch, yaw). To achieve this, I defined a function called "applyRigidTransform3D" in code 1 and "rigidTransform6D" in code 2 for the 6D movements, but I am not sure if this function is working correctly.
I would greatly appreciate any insights or suggestions regarding this code. Is my simulation realistic? If not, which parts contain errors? I would also welcome any recommended validation or sanity checks.
I have attached the MATLAB codes (Code1.m and Code2.m) below for reference.
Thank you! 3d volume, 6d movements, applyrigidtransform3d MATLAB Answers — New Questions
Trouble with Interp2
I am trying to use interp2 to look up values on in a table. I think that the problem is posed correctly (though obviously it is not), but all I get back is that the:
Error using interp2>makegriddedinterp (line 230)
Input grid is not a valid MESHGRID.
Error in interp2 (line 134)
F = makegriddedinterp(X, Y, V, method,extrap);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in LYNX_reflectivity_test_2 (line 61)
interp2(ang_mesh,ener_mesh,Refl,1,1000)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The code is below. The first step is to create a table of reflectivies as a function of angle and energy, interpolate that table line by line to create a finer grid in energy, and then test that the meshgrid works. That is where is fails, and I just can’t see what the problem is with the 2 interp2 statements at the bottom.
Thanks
Peter
Code below:
%Ir 10.nm/Cr 10.nm/SiO2 at 300.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 1000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 5000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 10000.eV, P=0.
%Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate
Ir_10nm_Cr_10nm= […
0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000
0.100000 0.982382 8.652573E-07 0.100000 0.980819 2.761637E-08 0.100000 0.961194 7.556862E-09 0.100000 0.970851 7.765713E-09
0.200000 0.965071 1.719669E-06 0.200000 0.961976 5.596694E-08 0.200000 0.922734 2.765021E-08 0.200000 0.938211 1.647113E-05
0.300000 0.948057 2.567899E-06 0.300000 0.943431 8.642812E-08 0.300000 0.883305 1.645055E-07 0.300000 0.892460 6.416535E-04
0.400000 0.931332 3.414433E-06 0.400000 0.925152 1.205377E-07 0.400000 0.841437 1.641682E-05 0.400000 0.776047 3.014587E-02
0.500000 0.914888 4.263738E-06 0.500000 0.907106 1.602024E-07 0.500000 0.795022 1.044327E-04 0.500000 0.414675 0.203665
0.600000 0.898715 5.120294E-06 0.600000 0.889262 2.079145E-07 0.600000 0.740373 6.502263E-04 0.600000 2.639916E-02 0.600880
0.700000 0.882807 5.988663E-06 0.700000 0.871589 2.670899E-07 0.700000 0.670460 4.532680E-03 0.700000 5.090132E-02 0.666863
0.800000 0.867156 6.873516E-06 0.800000 0.854059 3.426060E-07 0.800000 0.582072 1.752900E-02 0.800000 8.964668E-03 0.739812
0.900000 0.851754 7.779961E-06 0.900000 0.836637 4.418530E-07 0.900000 0.462636 3.669631E-02 0.900000 6.255109E-03 0.778701
1.00000 0.836595 8.712494E-06 1.00000 0.819307 5.757112E-07 1.00000 0.287212 8.603266E-02 1.00000 8.307789E-03 0.801262
1.10000 0.821673 9.676867E-06 1.10000 0.802032 7.623986E-07 1.10000 0.113086 0.191545 1.10000 3.204778E-03 0.823322
1.20000 0.806979 1.067877E-05 1.20000 0.784783 1.032557E-06 1.20000 4.265893E-02 0.302449 1.20000 1.369765E-03 0.841015
1.30000 0.792511 1.172367E-05 1.30000 0.767544 1.440837E-06 1.30000 3.424924E-02 0.377434 1.30000 2.013776E-03 0.853180
1.40000 0.778259 1.281891E-05 1.40000 0.750272 2.097700E-06 1.40000 4.541511E-02 0.422315 1.40000 2.044105E-03 0.863582
1.50000 0.764220 1.397090E-05 1.50000 0.732951 3.244685E-06 1.50000 3.447726E-02 0.462093 1.50000 8.998325E-05 0.874569
1.60000 0.750386 1.518820E-05 1.60000 0.715537 5.501835E-06 1.60000 1.121614E-02 0.507514 1.60000 8.285744E-04 0.881952
1.70000 0.736754 1.647850E-05 1.70000 0.698017 1.043718E-05 1.70000 3.812777E-03 0.545209 1.70000 9.592185E-04 0.888774
1.80000 0.723318 1.785118E-05 1.80000 0.680360 1.979164E-05 1.80000 5.419738E-03 0.572716 1.80000 1.404092E-04 0.895597
1.90000 0.710075 1.931691E-05 1.90000 0.662529 3.291488E-05 1.90000 6.503398E-03 0.595698 1.90000 3.395465E-04 0.901000
2.00000 0.697017 2.088734E-05 2.00000 0.644491 4.970375E-05 2.00000 8.737379E-03 0.614274 2.00000 3.610264E-04 0.905901
2.10000 0.684142 2.257595E-05 2.10000 0.626204 7.134984E-05 2.10000 8.188237E-03 0.631155 2.10000 3.175893E-04 0.910347
2.20000 0.671445 2.439662E-05 2.20000 0.607643 9.966306E-05 2.20000 3.437309E-03 0.649587 2.20000 3.847828E-05 0.914674
2.30000 0.658921 2.636680E-05 2.30000 0.588763 1.371713E-04 2.30000 5.906834E-04 0.666898 2.30000 2.018896E-04 0.918212
2.40000 0.646567 2.850380E-05 2.40000 0.569542 1.872420E-04 2.40000 1.199021E-03 0.680769 2.40000 2.279600E-04 0.921553
2.50000 0.634379 3.083119E-05 2.50000 0.549920 2.546647E-04 2.50000 1.850882E-03 0.692946 2.50000 2.762698E-05 0.924826
2.60000 0.622354 3.337174E-05 2.60000 0.529880 3.458717E-04 2.60000 2.201997E-03 0.704161 2.60000 1.045066E-04 0.927638
2.70000 0.610487 3.615420E-05 2.70000 0.509386 4.698597E-04 2.70000 2.767883E-03 0.714045 2.70000 1.058603E-04 0.930281
2.80000 0.598776 3.921089E-05 2.80000 0.488413 6.389660E-04 2.80000 2.139947E-03 0.723734 2.80000 9.618340E-05 0.932737
2.90000 0.587217 4.257846E-05 2.90000 0.466955 8.699156E-04 2.90000 6.292278E-04 0.733747 2.90000 1.226485E-05 0.935114
3.00000 0.575808 4.630103E-05 3.00000 0.445010 1.185337E-03 3.00000 1.415811E-04 0.742847 3.00000 7.197971E-05 0.937195];
angle = [0:.1:3];
energy = [300:970:10000];
[ener_mesh, ang_mesh] = meshgrid(energy,angle);
i = 1;
indexs = [2 5 8 11];
energy_start = [300 1000 5000 10000];
Refl = zeros(length(angle),length(energy));
row_i = zeros(1,length(energy));
%Refl(i,:) = ones(1,length(energy));
for i = 1:1:length(angle)
row_i = row_i*0;
row_i = interp1(energy_start,Ir_10nm_Cr_10nm(i,indexs),energy,"linear");
Refl(i,:) = row_i;
end %end of for
%test above
ang_mesh
ener_mesh
Refl
interp2(ang_mesh,ener_mesh,Refl,1,1000)
interp2(ang_mesh,ener_mesh,Refl,2.6,10000)I am trying to use interp2 to look up values on in a table. I think that the problem is posed correctly (though obviously it is not), but all I get back is that the:
Error using interp2>makegriddedinterp (line 230)
Input grid is not a valid MESHGRID.
Error in interp2 (line 134)
F = makegriddedinterp(X, Y, V, method,extrap);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in LYNX_reflectivity_test_2 (line 61)
interp2(ang_mesh,ener_mesh,Refl,1,1000)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The code is below. The first step is to create a table of reflectivies as a function of angle and energy, interpolate that table line by line to create a finer grid in energy, and then test that the meshgrid works. That is where is fails, and I just can’t see what the problem is with the 2 interp2 statements at the bottom.
Thanks
Peter
Code below:
%Ir 10.nm/Cr 10.nm/SiO2 at 300.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 1000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 5000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 10000.eV, P=0.
%Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate
Ir_10nm_Cr_10nm= […
0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000
0.100000 0.982382 8.652573E-07 0.100000 0.980819 2.761637E-08 0.100000 0.961194 7.556862E-09 0.100000 0.970851 7.765713E-09
0.200000 0.965071 1.719669E-06 0.200000 0.961976 5.596694E-08 0.200000 0.922734 2.765021E-08 0.200000 0.938211 1.647113E-05
0.300000 0.948057 2.567899E-06 0.300000 0.943431 8.642812E-08 0.300000 0.883305 1.645055E-07 0.300000 0.892460 6.416535E-04
0.400000 0.931332 3.414433E-06 0.400000 0.925152 1.205377E-07 0.400000 0.841437 1.641682E-05 0.400000 0.776047 3.014587E-02
0.500000 0.914888 4.263738E-06 0.500000 0.907106 1.602024E-07 0.500000 0.795022 1.044327E-04 0.500000 0.414675 0.203665
0.600000 0.898715 5.120294E-06 0.600000 0.889262 2.079145E-07 0.600000 0.740373 6.502263E-04 0.600000 2.639916E-02 0.600880
0.700000 0.882807 5.988663E-06 0.700000 0.871589 2.670899E-07 0.700000 0.670460 4.532680E-03 0.700000 5.090132E-02 0.666863
0.800000 0.867156 6.873516E-06 0.800000 0.854059 3.426060E-07 0.800000 0.582072 1.752900E-02 0.800000 8.964668E-03 0.739812
0.900000 0.851754 7.779961E-06 0.900000 0.836637 4.418530E-07 0.900000 0.462636 3.669631E-02 0.900000 6.255109E-03 0.778701
1.00000 0.836595 8.712494E-06 1.00000 0.819307 5.757112E-07 1.00000 0.287212 8.603266E-02 1.00000 8.307789E-03 0.801262
1.10000 0.821673 9.676867E-06 1.10000 0.802032 7.623986E-07 1.10000 0.113086 0.191545 1.10000 3.204778E-03 0.823322
1.20000 0.806979 1.067877E-05 1.20000 0.784783 1.032557E-06 1.20000 4.265893E-02 0.302449 1.20000 1.369765E-03 0.841015
1.30000 0.792511 1.172367E-05 1.30000 0.767544 1.440837E-06 1.30000 3.424924E-02 0.377434 1.30000 2.013776E-03 0.853180
1.40000 0.778259 1.281891E-05 1.40000 0.750272 2.097700E-06 1.40000 4.541511E-02 0.422315 1.40000 2.044105E-03 0.863582
1.50000 0.764220 1.397090E-05 1.50000 0.732951 3.244685E-06 1.50000 3.447726E-02 0.462093 1.50000 8.998325E-05 0.874569
1.60000 0.750386 1.518820E-05 1.60000 0.715537 5.501835E-06 1.60000 1.121614E-02 0.507514 1.60000 8.285744E-04 0.881952
1.70000 0.736754 1.647850E-05 1.70000 0.698017 1.043718E-05 1.70000 3.812777E-03 0.545209 1.70000 9.592185E-04 0.888774
1.80000 0.723318 1.785118E-05 1.80000 0.680360 1.979164E-05 1.80000 5.419738E-03 0.572716 1.80000 1.404092E-04 0.895597
1.90000 0.710075 1.931691E-05 1.90000 0.662529 3.291488E-05 1.90000 6.503398E-03 0.595698 1.90000 3.395465E-04 0.901000
2.00000 0.697017 2.088734E-05 2.00000 0.644491 4.970375E-05 2.00000 8.737379E-03 0.614274 2.00000 3.610264E-04 0.905901
2.10000 0.684142 2.257595E-05 2.10000 0.626204 7.134984E-05 2.10000 8.188237E-03 0.631155 2.10000 3.175893E-04 0.910347
2.20000 0.671445 2.439662E-05 2.20000 0.607643 9.966306E-05 2.20000 3.437309E-03 0.649587 2.20000 3.847828E-05 0.914674
2.30000 0.658921 2.636680E-05 2.30000 0.588763 1.371713E-04 2.30000 5.906834E-04 0.666898 2.30000 2.018896E-04 0.918212
2.40000 0.646567 2.850380E-05 2.40000 0.569542 1.872420E-04 2.40000 1.199021E-03 0.680769 2.40000 2.279600E-04 0.921553
2.50000 0.634379 3.083119E-05 2.50000 0.549920 2.546647E-04 2.50000 1.850882E-03 0.692946 2.50000 2.762698E-05 0.924826
2.60000 0.622354 3.337174E-05 2.60000 0.529880 3.458717E-04 2.60000 2.201997E-03 0.704161 2.60000 1.045066E-04 0.927638
2.70000 0.610487 3.615420E-05 2.70000 0.509386 4.698597E-04 2.70000 2.767883E-03 0.714045 2.70000 1.058603E-04 0.930281
2.80000 0.598776 3.921089E-05 2.80000 0.488413 6.389660E-04 2.80000 2.139947E-03 0.723734 2.80000 9.618340E-05 0.932737
2.90000 0.587217 4.257846E-05 2.90000 0.466955 8.699156E-04 2.90000 6.292278E-04 0.733747 2.90000 1.226485E-05 0.935114
3.00000 0.575808 4.630103E-05 3.00000 0.445010 1.185337E-03 3.00000 1.415811E-04 0.742847 3.00000 7.197971E-05 0.937195];
angle = [0:.1:3];
energy = [300:970:10000];
[ener_mesh, ang_mesh] = meshgrid(energy,angle);
i = 1;
indexs = [2 5 8 11];
energy_start = [300 1000 5000 10000];
Refl = zeros(length(angle),length(energy));
row_i = zeros(1,length(energy));
%Refl(i,:) = ones(1,length(energy));
for i = 1:1:length(angle)
row_i = row_i*0;
row_i = interp1(energy_start,Ir_10nm_Cr_10nm(i,indexs),energy,"linear");
Refl(i,:) = row_i;
end %end of for
%test above
ang_mesh
ener_mesh
Refl
interp2(ang_mesh,ener_mesh,Refl,1,1000)
interp2(ang_mesh,ener_mesh,Refl,2.6,10000) I am trying to use interp2 to look up values on in a table. I think that the problem is posed correctly (though obviously it is not), but all I get back is that the:
Error using interp2>makegriddedinterp (line 230)
Input grid is not a valid MESHGRID.
Error in interp2 (line 134)
F = makegriddedinterp(X, Y, V, method,extrap);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in LYNX_reflectivity_test_2 (line 61)
interp2(ang_mesh,ener_mesh,Refl,1,1000)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The code is below. The first step is to create a table of reflectivies as a function of angle and energy, interpolate that table line by line to create a finer grid in energy, and then test that the meshgrid works. That is where is fails, and I just can’t see what the problem is with the 2 interp2 statements at the bottom.
Thanks
Peter
Code below:
%Ir 10.nm/Cr 10.nm/SiO2 at 300.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 1000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 5000.eV, P=0. Ir 10.nm/Cr 10.nm/SiO2 at 10000.eV, P=0.
%Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate Angle (deg), Reflectivity, Transmission into substrate
Ir_10nm_Cr_10nm= […
0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000 0.000000 1.00000 0.000000
0.100000 0.982382 8.652573E-07 0.100000 0.980819 2.761637E-08 0.100000 0.961194 7.556862E-09 0.100000 0.970851 7.765713E-09
0.200000 0.965071 1.719669E-06 0.200000 0.961976 5.596694E-08 0.200000 0.922734 2.765021E-08 0.200000 0.938211 1.647113E-05
0.300000 0.948057 2.567899E-06 0.300000 0.943431 8.642812E-08 0.300000 0.883305 1.645055E-07 0.300000 0.892460 6.416535E-04
0.400000 0.931332 3.414433E-06 0.400000 0.925152 1.205377E-07 0.400000 0.841437 1.641682E-05 0.400000 0.776047 3.014587E-02
0.500000 0.914888 4.263738E-06 0.500000 0.907106 1.602024E-07 0.500000 0.795022 1.044327E-04 0.500000 0.414675 0.203665
0.600000 0.898715 5.120294E-06 0.600000 0.889262 2.079145E-07 0.600000 0.740373 6.502263E-04 0.600000 2.639916E-02 0.600880
0.700000 0.882807 5.988663E-06 0.700000 0.871589 2.670899E-07 0.700000 0.670460 4.532680E-03 0.700000 5.090132E-02 0.666863
0.800000 0.867156 6.873516E-06 0.800000 0.854059 3.426060E-07 0.800000 0.582072 1.752900E-02 0.800000 8.964668E-03 0.739812
0.900000 0.851754 7.779961E-06 0.900000 0.836637 4.418530E-07 0.900000 0.462636 3.669631E-02 0.900000 6.255109E-03 0.778701
1.00000 0.836595 8.712494E-06 1.00000 0.819307 5.757112E-07 1.00000 0.287212 8.603266E-02 1.00000 8.307789E-03 0.801262
1.10000 0.821673 9.676867E-06 1.10000 0.802032 7.623986E-07 1.10000 0.113086 0.191545 1.10000 3.204778E-03 0.823322
1.20000 0.806979 1.067877E-05 1.20000 0.784783 1.032557E-06 1.20000 4.265893E-02 0.302449 1.20000 1.369765E-03 0.841015
1.30000 0.792511 1.172367E-05 1.30000 0.767544 1.440837E-06 1.30000 3.424924E-02 0.377434 1.30000 2.013776E-03 0.853180
1.40000 0.778259 1.281891E-05 1.40000 0.750272 2.097700E-06 1.40000 4.541511E-02 0.422315 1.40000 2.044105E-03 0.863582
1.50000 0.764220 1.397090E-05 1.50000 0.732951 3.244685E-06 1.50000 3.447726E-02 0.462093 1.50000 8.998325E-05 0.874569
1.60000 0.750386 1.518820E-05 1.60000 0.715537 5.501835E-06 1.60000 1.121614E-02 0.507514 1.60000 8.285744E-04 0.881952
1.70000 0.736754 1.647850E-05 1.70000 0.698017 1.043718E-05 1.70000 3.812777E-03 0.545209 1.70000 9.592185E-04 0.888774
1.80000 0.723318 1.785118E-05 1.80000 0.680360 1.979164E-05 1.80000 5.419738E-03 0.572716 1.80000 1.404092E-04 0.895597
1.90000 0.710075 1.931691E-05 1.90000 0.662529 3.291488E-05 1.90000 6.503398E-03 0.595698 1.90000 3.395465E-04 0.901000
2.00000 0.697017 2.088734E-05 2.00000 0.644491 4.970375E-05 2.00000 8.737379E-03 0.614274 2.00000 3.610264E-04 0.905901
2.10000 0.684142 2.257595E-05 2.10000 0.626204 7.134984E-05 2.10000 8.188237E-03 0.631155 2.10000 3.175893E-04 0.910347
2.20000 0.671445 2.439662E-05 2.20000 0.607643 9.966306E-05 2.20000 3.437309E-03 0.649587 2.20000 3.847828E-05 0.914674
2.30000 0.658921 2.636680E-05 2.30000 0.588763 1.371713E-04 2.30000 5.906834E-04 0.666898 2.30000 2.018896E-04 0.918212
2.40000 0.646567 2.850380E-05 2.40000 0.569542 1.872420E-04 2.40000 1.199021E-03 0.680769 2.40000 2.279600E-04 0.921553
2.50000 0.634379 3.083119E-05 2.50000 0.549920 2.546647E-04 2.50000 1.850882E-03 0.692946 2.50000 2.762698E-05 0.924826
2.60000 0.622354 3.337174E-05 2.60000 0.529880 3.458717E-04 2.60000 2.201997E-03 0.704161 2.60000 1.045066E-04 0.927638
2.70000 0.610487 3.615420E-05 2.70000 0.509386 4.698597E-04 2.70000 2.767883E-03 0.714045 2.70000 1.058603E-04 0.930281
2.80000 0.598776 3.921089E-05 2.80000 0.488413 6.389660E-04 2.80000 2.139947E-03 0.723734 2.80000 9.618340E-05 0.932737
2.90000 0.587217 4.257846E-05 2.90000 0.466955 8.699156E-04 2.90000 6.292278E-04 0.733747 2.90000 1.226485E-05 0.935114
3.00000 0.575808 4.630103E-05 3.00000 0.445010 1.185337E-03 3.00000 1.415811E-04 0.742847 3.00000 7.197971E-05 0.937195];
angle = [0:.1:3];
energy = [300:970:10000];
[ener_mesh, ang_mesh] = meshgrid(energy,angle);
i = 1;
indexs = [2 5 8 11];
energy_start = [300 1000 5000 10000];
Refl = zeros(length(angle),length(energy));
row_i = zeros(1,length(energy));
%Refl(i,:) = ones(1,length(energy));
for i = 1:1:length(angle)
row_i = row_i*0;
row_i = interp1(energy_start,Ir_10nm_Cr_10nm(i,indexs),energy,"linear");
Refl(i,:) = row_i;
end %end of for
%test above
ang_mesh
ener_mesh
Refl
interp2(ang_mesh,ener_mesh,Refl,1,1000)
interp2(ang_mesh,ener_mesh,Refl,2.6,10000) interp2 question MATLAB Answers — New Questions
How to use a thermocouple block available in simscape block?
How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model.How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model. How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model. thermocouple, simscape MATLAB Answers — New Questions
Peak Finder / Bandpass Filter errors on SimElectrical
I am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J CI am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J C I am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J C simulink, filter, filter design, sine wave MATLAB Answers — New Questions
Error while debugging the customized simscape component
Hello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
AziziHello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
Azizi Hello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
Azizi simscape language, simulation error, simscape MATLAB Answers — New Questions
how are additional samples added to the audiostreamer playrec output queue?
If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug)If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug) If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug) audiostreamer, playrec MATLAB Answers — New Questions
Using the Ideal Heat Flow Source block
Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me).Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me). Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me). simscape MATLAB Answers — New Questions
Microsoft Graph PowerShell SDK V2.34 Makes WAM the Default
Web Account Manager Enabled with No Workaround
With the holiday season fully engaged, people like me have blog posts scheduled a few days in advance to allow for some downtime. Which is why I missed Microsoft releasing V2.34 of the Microsoft Graph PowerShell SDK on Saturday, December 20. 2025 and didn’t include a very important change made in that release in V19 of the Automating Microsoft 365 with PowerShell eBook.
Microsoft doesn’t typically push a new version of a major software product over the weekend, especially as they released V2.33 a scant twelve days previously. When something like this happens, people like me become instantly suspicious that Microsoft or customers have discovered something very bad that required patching. The poor quality record of the Microsoft Graph PowerShell SDK earlier this year naturally brings bugs to mind (like those found in V2.26).
Windows Account Manager Becomes the Default
Finding out what happened is problematic because a large number of Microsoft engineering personnel are on vacation. According to the people I reached, the only change in V2.34 is to make use of the Web Account Manager (WAM) mandatory for interactive Graph connections.
WAM is an authentication broker that the Microsoft Graph PowerShell SDK previously supported to enable token protection. However, problems with the previous implementation, such as lack of support for administrator connections and a module clash with the Azure Identity Broker effectively stopped WAM working with SDK connections after V2.25. Microsoft has fixed the problems and WAM is now the default login experience for Graph SDK interactive connections, including sessions that use administrator accounts. After installing V2.34, you will notice a different UI to select the account used to connect (Figure 1).

In addition, you’ll see this text after a successful connection:
NOTE: Sign in by Web Account Manager (WAM) is enabled by default on Windows systems and cannot be disabled. Any setting stating otherwise will be ignored.
Possibly Related to a Security Issue
Fixing a problem that’s been around for a few versions and then suddenly rushing out a new release over a weekend is just strange. Microsoft only ever does something like this when it responds to a security issue. What might have happened is that Microsoft has been made aware of a vulnerability that affects the Microsoft Graph PowerShell SDK and moved to close off the issue as quickly as possible.
The holiday period will likely lead to a lack of communication until everyone returns from vacation. In the interim, my recommendation is that you upgrade non-production systems to V2.34, test scripts to make sure that they work as expected (so far, all my scripts have worked) and then deploy V2.34 into production.
The update does not affect Azure Automation runbooks that use Microsoft Graph PowerShell SDK cmdlets. It is only relevant for interactive delegated sessions. Interactive app-only sessions use a different authentication route and are unaffected by WAM.
If you use Windows PowerShell V5.1 to run Microsoft Graph PowerShell SDK sessions, you might run into the same problem as reported here. Microsoft is aware of the issue and is investigating. The issue does not arise with PowerShell Core (V7; I used V7.5.4 for testing). I recommend that PowerShell Core is used for all production use of the Microsoft Graph PowerShell SDK.
A Popular Component
On a positive note, even if it’s a pain to be forced to upgrade to a new version twelve days after the previous release, it’s good to see Microsoft take action to fix known issues. V2.32 of the Microsoft Graph PowerShell SDK had over 880K downloads, so it’s obviously an important component for many Microsoft 365 tenants. Protecting those kinds of components is obvious important, as is keeping book content updated. Which is why V19.1 of the Automating Microsoft 365 with PowerShell eBook is now available for download.
How do I Create an array of plots. The results disapear into “handle to deleted PolarCompassPlot” See code
clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot"clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot" clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot" plot_num MATLAB Answers — New Questions
Why am i getting error “you don’t have permissions to folder /usr/MATLAB/R2024b” while installing R2025a?
Yes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the helpYes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the help Yes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the help r2025a, updating MATLAB Answers — New Questions
Matlab function ‘movmean’ doesn’t work on simulink
I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well)I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well) I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well) matlab, simulink, movmean MATLAB Answers — New Questions
Can I purchase additional packages/toolboxes after purchasing the student version of MATLAB?
In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase?In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase? In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase? matlab, toolbox, students home MATLAB Answers — New Questions
Best practices for setting penalty values in objective functions for bayesopt in MATLAB
Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks!Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks! Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks! optimization, matlab MATLAB Answers — New Questions
Automating Microsoft 365 with PowerShell Update 19
Update Part of Office 365 for IT Pros January 2026 Release
The Office 365 for IT Pros team is delighted to announce that update #19 for the Automating Microsoft 365 with PowerShell eBook is available for subscribers to download. Please use the link in the receipt emailed after purchase or your Gumroad.com account to fetch the updated PDF and EPUB files. We have also updated the Kindle and Paperback editions available from Amazon.com. Subscribers who purchase through Gumroad can transfer the EPUB version to Kindle.
Updates and Revisions
Like all our monthly updates, update #19 contains a mixture of new material, updates, and revisions. The pace of change in the Microsoft world eases at this time of year as Microsoft engineers take time out for the holidays, so there’s nothing dramatic to report in terms of new content.
Largely because not much has happened with the SharePoint Online management module, it was nice to see Microsoft deliver support for app-only authentication based on X.509 certificates. This is still a Windows PowerShell module. Even if it’s possible to use the module with PowerShell Core, it would be nice if Microsoft did the necessary work to upgrade the module fully.
The New Create Site Graph API
Also in the SharePoint space, I think it’s fair to say that Graph API coverage for SharePoint Online is spotty in places. For instance, while a Graph API exists to create a SharePoint list, you can’t create a SharePoint site unless you’re creating a Microsoft 365 group or team, in which case background provisioning takes care of creating the associated site. On November 24, 2025, Microsoft announced the beta of a Graph API to create sites (Figure 1) together with a new Site.Create.All Graph permission to reduce the level of permission needed for an app or person to create sites.

Documentation for the create Site API is available online. Initially, I couldn’t get the API to work at all and reported the fact to Microsoft. Some tweaking clearly took place and now this code works to create a communications site.
$Uri = "https://graph.microsoft.com/beta/sites/"
$Params = @{
name = "Communication Site Test"
webUrl = "https://office365itpros.sharepoint.com/sites/commsite1"
locale = "en-US"
shareByEmailEnabled = $false
description = "A test communication site"
template = "sitepagepublishing"
ownerIdentityToResolve = @{
email = "Marty.King@Office365itpros.com"
}
}
Invoke-MgGraphRequest -Uri $Uri -Method POST -Body $Params
Changing the template type to sts (team site without a Microsoft 365 group) also works. However, any attempt to create a site using the group template fails with a 500 internal server error. It’s unsurprising that the creation of the most complex site type would run into some problems. In any case, the Microsoft Graph PowerShell SDK doesn’t include a cmdlet for the create Site API, so we don’t currently cover the API in Automating Microsoft 365 with PowerShell. Hopefully, the issue with the (beta) API will be resolved soon and we’ll include coverage in the next eBook update.
New Version of the Microsoft Graph PowerShell SDK
Microsoft released V2.33 of the Microsoft Graph PowerShell SDK on 9 December 2025. So far, everything appears stable. However, the first report of a V2.33 problem popped up in GitHub with an error in the New-MgTeamChannelMember cmdlet. As it turns out, it seems like a) the issue has been around going back to at least V2.28, and b) the usual workaround of using the Graph API works. For example:
$User = Get-MgUser -UserId Alain.Charnier@Office365itpros.com
$Team = Get-MgTeam -Filter "DisplayName eq 'Microsoft 365 Adoption'"
$Channel = Get-MgTeamChannel -TeamId $Team.Id -Filter "DisplayName eq 'Project Infinity'"
$Uri = ("https://graph.microsoft.com/v1.0/teams/{0}/channels/{1}/members" -f $Team.id, $Channel.id)
$Roles = @("member")
$UserId = $User.Id
$Body = @{}
$Body.Add("@odata.type", "#microsoft.graph.aadUserConversationMember")
$Body.Add("roles", $Roles)
$Body.Add("user@odata.bind", "https://graph.microsoft.com/v1.0/users('$UserId')")
Invoke-MgGraphRequest -Uri $uri -Method POST -Body $Body
Microsoft subsequently released V2.34 on 20 December 2025. Pushing out a new release so soon after V2.33 is odd, especially just before a major holiday period. I can’t find any information (the engineers are all on holiday) about why they pushed a new version so quickly, so test V2.33 or V2.34 very carefully before putting either version into production.
Speaking of which, if you’re looking for code to test with, why not visit the Office 365 for IT Pros GitHub repository. I’m sure that you’ll find something there to test common Microsoft Graph PowerShell SDK cmdlets.









