Month: March 2026
Variables of varying size in Simulink – avoiding preallocation
I have a matlab script that controls a Simulink model for code generation. Currently I preassign a varaible X to be the maximum possible size of the array (100 rows) along with a constant 8 columns. A coplicated for loop code block runs to decide which of the variables looped over will get added to the variable X. Depeding on settings this can be anywhere between 6 rows and 100 rows filled. It seems very cumbersome to have a 100×8 permanently when there is eg only info in the top 6×8 portion as this matrix then gets used by other Simulink submodels. All my attempts at creating a varaible array size have come up against issues with errors such as ‘Error in port dimensions’. Is there any way for Simulink to avoid preallocating the variable size or reducing the size of the array once populated.I have a matlab script that controls a Simulink model for code generation. Currently I preassign a varaible X to be the maximum possible size of the array (100 rows) along with a constant 8 columns. A coplicated for loop code block runs to decide which of the variables looped over will get added to the variable X. Depeding on settings this can be anywhere between 6 rows and 100 rows filled. It seems very cumbersome to have a 100×8 permanently when there is eg only info in the top 6×8 portion as this matrix then gets used by other Simulink submodels. All my attempts at creating a varaible array size have come up against issues with errors such as ‘Error in port dimensions’. Is there any way for Simulink to avoid preallocating the variable size or reducing the size of the array once populated. I have a matlab script that controls a Simulink model for code generation. Currently I preassign a varaible X to be the maximum possible size of the array (100 rows) along with a constant 8 columns. A coplicated for loop code block runs to decide which of the variables looped over will get added to the variable X. Depeding on settings this can be anywhere between 6 rows and 100 rows filled. It seems very cumbersome to have a 100×8 permanently when there is eg only info in the top 6×8 portion as this matrix then gets used by other Simulink submodels. All my attempts at creating a varaible array size have come up against issues with errors such as ‘Error in port dimensions’. Is there any way for Simulink to avoid preallocating the variable size or reducing the size of the array once populated. simulink, variable, matrix array MATLAB Answers — New Questions
Trying to filter timeseries data by logical index on time within matlab function block but it tells me property Time not recognized as valid
I’m trying to load a year-long timeseries from a .mat file and then select a single day’s data from that file within a matlab function block. The loaded timeseries data is one input to the block (tsinput) and a number indicating the day of interest in MMDD format is the other input (daynum). My function block code is:
function tsoutput = fcn(tsinput, daynum)
%find the doy for the daystr input
datestr = strcat(daynum,’2023′);
coder.extrinsic(‘datetime’);
datedt = datetime(datestr, ‘InputFormat’, ‘MMddyyyy’);
coder.extrinsic(‘day’);
datedoy = day(datedt,’dayofyear’);
mask = tsinput.Time>datedoy & tsinput.Time<datedoy+1;
% Create a new timeseries with only those samples
tsoutput = getsamples(tsinput, mask);
But when I try running my simulink code, which is just a from file block and constant number block with the matlab function block, I get these errors:
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Component:MATLAB Function | Category:Coder error
Property ‘Time’ is not recognized as valid.
Function ‘MATLAB Function’ (#36.261.273), line 10, column 8:
"tsinput.Time"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of ‘testdataload/MATLAB Function’.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error in port widths or dimensions. ‘Output Port 1’ of ‘testdataload/MATLAB Function/tsinput’ is a one dimensional vector with 1 elements.
Component:Simulink | Category:Model errorI’m trying to load a year-long timeseries from a .mat file and then select a single day’s data from that file within a matlab function block. The loaded timeseries data is one input to the block (tsinput) and a number indicating the day of interest in MMDD format is the other input (daynum). My function block code is:
function tsoutput = fcn(tsinput, daynum)
%find the doy for the daystr input
datestr = strcat(daynum,’2023′);
coder.extrinsic(‘datetime’);
datedt = datetime(datestr, ‘InputFormat’, ‘MMddyyyy’);
coder.extrinsic(‘day’);
datedoy = day(datedt,’dayofyear’);
mask = tsinput.Time>datedoy & tsinput.Time<datedoy+1;
% Create a new timeseries with only those samples
tsoutput = getsamples(tsinput, mask);
But when I try running my simulink code, which is just a from file block and constant number block with the matlab function block, I get these errors:
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Component:MATLAB Function | Category:Coder error
Property ‘Time’ is not recognized as valid.
Function ‘MATLAB Function’ (#36.261.273), line 10, column 8:
"tsinput.Time"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of ‘testdataload/MATLAB Function’.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error in port widths or dimensions. ‘Output Port 1’ of ‘testdataload/MATLAB Function/tsinput’ is a one dimensional vector with 1 elements.
Component:Simulink | Category:Model error I’m trying to load a year-long timeseries from a .mat file and then select a single day’s data from that file within a matlab function block. The loaded timeseries data is one input to the block (tsinput) and a number indicating the day of interest in MMDD format is the other input (daynum). My function block code is:
function tsoutput = fcn(tsinput, daynum)
%find the doy for the daystr input
datestr = strcat(daynum,’2023′);
coder.extrinsic(‘datetime’);
datedt = datetime(datestr, ‘InputFormat’, ‘MMddyyyy’);
coder.extrinsic(‘day’);
datedoy = day(datedt,’dayofyear’);
mask = tsinput.Time>datedoy & tsinput.Time<datedoy+1;
% Create a new timeseries with only those samples
tsoutput = getsamples(tsinput, mask);
But when I try running my simulink code, which is just a from file block and constant number block with the matlab function block, I get these errors:
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Component:MATLAB Function | Category:Coder error
Property ‘Time’ is not recognized as valid.
Function ‘MATLAB Function’ (#36.261.273), line 10, column 8:
"tsinput.Time"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of ‘testdataload/MATLAB Function’.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink is unable to determine sizes and/or types of the outputs for block ‘testdataload/MATLAB Function’ due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error in port widths or dimensions. ‘Output Port 1’ of ‘testdataload/MATLAB Function/tsinput’ is a one dimensional vector with 1 elements.
Component:Simulink | Category:Model error simulink, matlab function block, timeseries, logical index MATLAB Answers — New Questions
install_addon(‘smlink.r2017b.win64.zip’) Undefined function or variable ‘install_addon’
any one who can help me to interface matlab and solidwork
i use >>install_addon(‘smlink.r2017b.win64.zip’)
in command window but it displays
Undefined function or variable ‘install_addon’any one who can help me to interface matlab and solidwork
i use >>install_addon(‘smlink.r2017b.win64.zip’)
in command window but it displays
Undefined function or variable ‘install_addon’ any one who can help me to interface matlab and solidwork
i use >>install_addon(‘smlink.r2017b.win64.zip’)
in command window but it displays
Undefined function or variable ‘install_addon’ solid MATLAB Answers — New Questions
matlab/simulink+tensorflow problem
My MATLAB can connect to Python and execute Python statements, but it encounters an error when importing TensorFlow. How can I resolve this?
In the MATLAB command line, when I enter:
py.importlib.import_module(‘tensorflow’)
an error occurs:
“error to use pywrap_tensorflow><module> (line 88)
Python error ImportError: Traceback (most recent call last):
File "C:UsersLENOVO.condaenvsmatlab_testlibsite-packagestensorflowpythonpywrap_tensorflow.py", line 73, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error
message.
Error in __init__><module> (line 40)
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
”
My matlab version is R2024a, python== 3.9, tensorflow-cpu==2.19
When I import TensorFlow in the Python command line, there is no problem, but when I do so in MATLAB, the above error occurs.
I’ve tried a few solutions, but none of them worked:
Install Microsoft Visual C++ Redistributable
Switch tensorflow from GPU version to CPU version
Use Anaconda to isolate dependencies for different projects.
please help me !!!!!My MATLAB can connect to Python and execute Python statements, but it encounters an error when importing TensorFlow. How can I resolve this?
In the MATLAB command line, when I enter:
py.importlib.import_module(‘tensorflow’)
an error occurs:
“error to use pywrap_tensorflow><module> (line 88)
Python error ImportError: Traceback (most recent call last):
File "C:UsersLENOVO.condaenvsmatlab_testlibsite-packagestensorflowpythonpywrap_tensorflow.py", line 73, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error
message.
Error in __init__><module> (line 40)
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
”
My matlab version is R2024a, python== 3.9, tensorflow-cpu==2.19
When I import TensorFlow in the Python command line, there is no problem, but when I do so in MATLAB, the above error occurs.
I’ve tried a few solutions, but none of them worked:
Install Microsoft Visual C++ Redistributable
Switch tensorflow from GPU version to CPU version
Use Anaconda to isolate dependencies for different projects.
please help me !!!!! My MATLAB can connect to Python and execute Python statements, but it encounters an error when importing TensorFlow. How can I resolve this?
In the MATLAB command line, when I enter:
py.importlib.import_module(‘tensorflow’)
an error occurs:
“error to use pywrap_tensorflow><module> (line 88)
Python error ImportError: Traceback (most recent call last):
File "C:UsersLENOVO.condaenvsmatlab_testlibsite-packagestensorflowpythonpywrap_tensorflow.py", line 73, in <module>
from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: Dynamic link library (DLL) initialization routine failed.
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/errors for some common causes and solutions.
If you need help, create an issue at https://github.com/tensorflow/tensorflow/issues and include the entire stack trace above this error
message.
Error in __init__><module> (line 40)
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
”
My matlab version is R2024a, python== 3.9, tensorflow-cpu==2.19
When I import TensorFlow in the Python command line, there is no problem, but when I do so in MATLAB, the above error occurs.
I’ve tried a few solutions, but none of them worked:
Install Microsoft Visual C++ Redistributable
Switch tensorflow from GPU version to CPU version
Use Anaconda to isolate dependencies for different projects.
please help me !!!!! deep learning, tensorflow MATLAB Answers — New Questions
How to understand the input and output arguments of preparets function for network training
For training NARX network, we need to prepare input and target time series data using preparets function. However, the preparets function has many input and output arguments which are confused for me to understand their functioning. I have read the examples about preparets, yet it is still difficult to understand. What is the best practice to understand the preparets and correctly use it under different network training scenarios ?
help preparets
EDIT: removed copyright code.For training NARX network, we need to prepare input and target time series data using preparets function. However, the preparets function has many input and output arguments which are confused for me to understand their functioning. I have read the examples about preparets, yet it is still difficult to understand. What is the best practice to understand the preparets and correctly use it under different network training scenarios ?
help preparets
EDIT: removed copyright code. For training NARX network, we need to prepare input and target time series data using preparets function. However, the preparets function has many input and output arguments which are confused for me to understand their functioning. I have read the examples about preparets, yet it is still difficult to understand. What is the best practice to understand the preparets and correctly use it under different network training scenarios ?
help preparets
EDIT: removed copyright code. network training, narx, preparets MATLAB Answers — New Questions
Patch FaceVertexCData being overwritten by FaceColor
Hello,
I am attempting to set up a patch with R2016b wherein one face of the patch has a certain color, and the rest share another. To do this I set up an (m x 3) array, "FacetColor," that assigned an RGB triplet to every face in the patch, according to its position in the geometry. The patch was then created with the code:
fv=struct(‘faces’,facet,’vertices’,vertex);
h=patch(fv,’FaceVertexCData’, FacetColor, …
‘EdgeColor’, ‘none’, …
‘FaceLighting’, ‘gouraud’, …
‘AmbientStrength’, 0.4);
alpha(h,1);
Unfortunately, whenever I attempt to run this code, MATLAB apparently ignores my FacetColor array and instead uses the default FaceColor value of [0 0 0]. This turns the entire patch uniformly black. I tried setting the FaceColor value to ‘none,’ thinking that doing so might force MATLAB to use the FaceVertexCData field, but instead it causes the patch to turn invisible. How am I configuring this patch incorrectly?
Any advice or assistance would be appreciated! My thanks in advance.Hello,
I am attempting to set up a patch with R2016b wherein one face of the patch has a certain color, and the rest share another. To do this I set up an (m x 3) array, "FacetColor," that assigned an RGB triplet to every face in the patch, according to its position in the geometry. The patch was then created with the code:
fv=struct(‘faces’,facet,’vertices’,vertex);
h=patch(fv,’FaceVertexCData’, FacetColor, …
‘EdgeColor’, ‘none’, …
‘FaceLighting’, ‘gouraud’, …
‘AmbientStrength’, 0.4);
alpha(h,1);
Unfortunately, whenever I attempt to run this code, MATLAB apparently ignores my FacetColor array and instead uses the default FaceColor value of [0 0 0]. This turns the entire patch uniformly black. I tried setting the FaceColor value to ‘none,’ thinking that doing so might force MATLAB to use the FaceVertexCData field, but instead it causes the patch to turn invisible. How am I configuring this patch incorrectly?
Any advice or assistance would be appreciated! My thanks in advance. Hello,
I am attempting to set up a patch with R2016b wherein one face of the patch has a certain color, and the rest share another. To do this I set up an (m x 3) array, "FacetColor," that assigned an RGB triplet to every face in the patch, according to its position in the geometry. The patch was then created with the code:
fv=struct(‘faces’,facet,’vertices’,vertex);
h=patch(fv,’FaceVertexCData’, FacetColor, …
‘EdgeColor’, ‘none’, …
‘FaceLighting’, ‘gouraud’, …
‘AmbientStrength’, 0.4);
alpha(h,1);
Unfortunately, whenever I attempt to run this code, MATLAB apparently ignores my FacetColor array and instead uses the default FaceColor value of [0 0 0]. This turns the entire patch uniformly black. I tried setting the FaceColor value to ‘none,’ thinking that doing so might force MATLAB to use the FaceVertexCData field, but instead it causes the patch to turn invisible. How am I configuring this patch incorrectly?
Any advice or assistance would be appreciated! My thanks in advance. patch, facevertexcdata, facecolor MATLAB Answers — New Questions
I have downloaded this package, but can not seem to use the “readDistance’ command.
I have downloaded this package, but can not seem to use the "readDistance’ command.
distance = readDistanceI have downloaded this package, but can not seem to use the "readDistance’ command.
distance = readDistance I have downloaded this package, but can not seem to use the "readDistance’ command.
distance = readDistance hc-sr04, error MATLAB Answers — New Questions
How can I see the (binomial) value of the AM2302 temperature sensor on the display?
Hi,
I’ve create a DHT11 Sensor Block with this documentation. Create DHT11 Block
But when I click on "Monitor and Tune", I have an error message, see in DHT11_model…txt.
Thanks for your help.Hi,
I’ve create a DHT11 Sensor Block with this documentation. Create DHT11 Block
But when I click on "Monitor and Tune", I have an error message, see in DHT11_model…txt.
Thanks for your help. Hi,
I’ve create a DHT11 Sensor Block with this documentation. Create DHT11 Block
But when I click on "Monitor and Tune", I have an error message, see in DHT11_model…txt.
Thanks for your help. value temperature MATLAB Answers — New Questions
How do I get the total impedance for one circuit of impedances?
I’m trying to get to total impedance where the impedance measurement block is but I can’t connect it to the circuit. Even the PS converter don’t seem to work to connect it to the block or the circuit. Any suggestion on how to make it work or which library and components use just putting the impedances and getting the total one?I’m trying to get to total impedance where the impedance measurement block is but I can’t connect it to the circuit. Even the PS converter don’t seem to work to connect it to the block or the circuit. Any suggestion on how to make it work or which library and components use just putting the impedances and getting the total one? I’m trying to get to total impedance where the impedance measurement block is but I can’t connect it to the circuit. Even the PS converter don’t seem to work to connect it to the block or the circuit. Any suggestion on how to make it work or which library and components use just putting the impedances and getting the total one? impedance, simulink MATLAB Answers — New Questions
In my COMSOL – PHREEQC Coupling using Matlab Interface, how to update solution for next time step??
I’m currently trying to use COMSOL – PHREEQC Coupling using Matlab Interface for reactive transport modeling. I’m trying Wissmeier & Barry (2011) approach for this. Currently, I’m facing the issue of solution from phreeqc is not being updated in comsol and the transport is not evolving in my simulation. I’m trying to simulate example 11 of phreeqc manual (Cation exchange). Can anyone help me with this?I’m currently trying to use COMSOL – PHREEQC Coupling using Matlab Interface for reactive transport modeling. I’m trying Wissmeier & Barry (2011) approach for this. Currently, I’m facing the issue of solution from phreeqc is not being updated in comsol and the transport is not evolving in my simulation. I’m trying to simulate example 11 of phreeqc manual (Cation exchange). Can anyone help me with this? I’m currently trying to use COMSOL – PHREEQC Coupling using Matlab Interface for reactive transport modeling. I’m trying Wissmeier & Barry (2011) approach for this. Currently, I’m facing the issue of solution from phreeqc is not being updated in comsol and the transport is not evolving in my simulation. I’m trying to simulate example 11 of phreeqc manual (Cation exchange). Can anyone help me with this? comsol, phreeqc, livelink, solution vector MATLAB Answers — New Questions
Request for MATLAB Code Review and Correction
The image contains the Transmission Line (TRL) equation. I am trying to develop a MATLAB code that matches this equation accurately. However, I need to verify that the implementation is consistent with the mathematical expression shown in the image.
Could you please review it and help ensure that the MATLAB code correctly follows the TRL equation?
Here this matlab code
clc;
clear;
% ===== Constants =====
c = 3e8; % Speed of light (m/s)
d = 2.62e-3; % Thickness in meters (example: 2.62 mm)
% ——————- Ask user to select Excel file ——————-
[filename, pathname] = uigetfile(‘*.xlsx’, ‘Select your S-parameter Excel file’);
if isequal(filename,0)
error(‘No file selected. Exiting…’);
end
filepath = fullfile(pathname, filename);
% ===== Read data from Excel =====
% Make sure your Excel file has columns: frequency(Hz), e’, e”, u’, u”
data = readmatrix(filepath); % Reads all numeric data
f = data(:,1); % Frequency in Hz
ep_real = data(:,2); % e’
ep_imag = data(:,3); % e”
mu_real = data(:,4); % u’
mu_imag = data(:,5); % u”
% ===== Complex parameters =====
eps_r = ep_real – 1i*ep_imag;
mu_r = mu_real – 1i*mu_imag;
% ===== Input impedance calculation =====
Zin = sqrt(mu_r ./ eps_r) .* tanh(-1i .* (2*pi.*f.*d./c) .* sqrt(mu_r .* eps_r));
% ===== Reflection Loss =====
RL = 20*log10(abs((Zin – 1) ./ (Zin + 1)));
% ===== Reflection coefficient =====
Gamma = abs((Zin – 1) ./ (Zin + 1));
% ===== Absorption percentage =====
Absorption = (1 – Gamma.^2) * 100;
% ===== Display results =====
Result = table(f, RL, Absorption)
% ===== Plot RL =====
figure
plot(f/1e9, RL,’LineWidth’,2)
xlabel(‘Frequency (GHz)’)
ylabel(‘Reflection Loss (dB)’)
title(‘Reflection Loss vs Frequency’)
grid onThe image contains the Transmission Line (TRL) equation. I am trying to develop a MATLAB code that matches this equation accurately. However, I need to verify that the implementation is consistent with the mathematical expression shown in the image.
Could you please review it and help ensure that the MATLAB code correctly follows the TRL equation?
Here this matlab code
clc;
clear;
% ===== Constants =====
c = 3e8; % Speed of light (m/s)
d = 2.62e-3; % Thickness in meters (example: 2.62 mm)
% ——————- Ask user to select Excel file ——————-
[filename, pathname] = uigetfile(‘*.xlsx’, ‘Select your S-parameter Excel file’);
if isequal(filename,0)
error(‘No file selected. Exiting…’);
end
filepath = fullfile(pathname, filename);
% ===== Read data from Excel =====
% Make sure your Excel file has columns: frequency(Hz), e’, e”, u’, u”
data = readmatrix(filepath); % Reads all numeric data
f = data(:,1); % Frequency in Hz
ep_real = data(:,2); % e’
ep_imag = data(:,3); % e”
mu_real = data(:,4); % u’
mu_imag = data(:,5); % u”
% ===== Complex parameters =====
eps_r = ep_real – 1i*ep_imag;
mu_r = mu_real – 1i*mu_imag;
% ===== Input impedance calculation =====
Zin = sqrt(mu_r ./ eps_r) .* tanh(-1i .* (2*pi.*f.*d./c) .* sqrt(mu_r .* eps_r));
% ===== Reflection Loss =====
RL = 20*log10(abs((Zin – 1) ./ (Zin + 1)));
% ===== Reflection coefficient =====
Gamma = abs((Zin – 1) ./ (Zin + 1));
% ===== Absorption percentage =====
Absorption = (1 – Gamma.^2) * 100;
% ===== Display results =====
Result = table(f, RL, Absorption)
% ===== Plot RL =====
figure
plot(f/1e9, RL,’LineWidth’,2)
xlabel(‘Frequency (GHz)’)
ylabel(‘Reflection Loss (dB)’)
title(‘Reflection Loss vs Frequency’)
grid on The image contains the Transmission Line (TRL) equation. I am trying to develop a MATLAB code that matches this equation accurately. However, I need to verify that the implementation is consistent with the mathematical expression shown in the image.
Could you please review it and help ensure that the MATLAB code correctly follows the TRL equation?
Here this matlab code
clc;
clear;
% ===== Constants =====
c = 3e8; % Speed of light (m/s)
d = 2.62e-3; % Thickness in meters (example: 2.62 mm)
% ——————- Ask user to select Excel file ——————-
[filename, pathname] = uigetfile(‘*.xlsx’, ‘Select your S-parameter Excel file’);
if isequal(filename,0)
error(‘No file selected. Exiting…’);
end
filepath = fullfile(pathname, filename);
% ===== Read data from Excel =====
% Make sure your Excel file has columns: frequency(Hz), e’, e”, u’, u”
data = readmatrix(filepath); % Reads all numeric data
f = data(:,1); % Frequency in Hz
ep_real = data(:,2); % e’
ep_imag = data(:,3); % e”
mu_real = data(:,4); % u’
mu_imag = data(:,5); % u”
% ===== Complex parameters =====
eps_r = ep_real – 1i*ep_imag;
mu_r = mu_real – 1i*mu_imag;
% ===== Input impedance calculation =====
Zin = sqrt(mu_r ./ eps_r) .* tanh(-1i .* (2*pi.*f.*d./c) .* sqrt(mu_r .* eps_r));
% ===== Reflection Loss =====
RL = 20*log10(abs((Zin – 1) ./ (Zin + 1)));
% ===== Reflection coefficient =====
Gamma = abs((Zin – 1) ./ (Zin + 1));
% ===== Absorption percentage =====
Absorption = (1 – Gamma.^2) * 100;
% ===== Display results =====
Result = table(f, RL, Absorption)
% ===== Plot RL =====
figure
plot(f/1e9, RL,’LineWidth’,2)
xlabel(‘Frequency (GHz)’)
ylabel(‘Reflection Loss (dB)’)
title(‘Reflection Loss vs Frequency’)
grid on transmission line theory trl equation matlab ma MATLAB Answers — New Questions
Automating Microsoft 365 with PowerShell Update #22
Automating Microsoft 365 with PowerShell April 2026 Update

As is our normal practice, we have released the regular update for the Automating Microsoft 365 with PowerShell eBook ahead of the monthly update for the main Office 365 for IT Pros eBook. This cadence gives us less to worry about when we bring everything together for a “big book” update. We anticipate releasing the April 2026 update (#130) for Office 365 for IT Pros on April 1, 2026.
In the meanwhile, current subscribers for both the Office 365 for IT Pros (2026 edition) and Automating Microsoft 365 with PowerShell eBooks can download the updated EPUB and PDF files for V22.1 (dated 18 March 2026) through their Gumroad.com account or by using the link in their receipt. The Kindle and Paperback editions of the book have been updated in Amazon.
Changes in Update #22
The major updates in update #22 cover:
- How to use Exchange Online RBAC administrative role groups to grant access for Azure Automation accounts to use Exchange Online PowerShell in runbooks.
- What Graph navigable properties are and how to use these properties when fetching data with Graph API requests.
- Rationalization and expansion of the coverage for the addititionalProperties property and why the Microsoft Graph PowerShell SDK stuffs so much valuable information into the additionalProperties property.
As usual, a bunch of smaller changes were made throughout the book. We continue to find and improve the PowerShell examples throughout the book to reflect new knowledge and best practice. Well, what we think is best practice (or seems to be a good idea)!
Microsoft Graph PowerShell SDK V2.36.1
Microsoft released V2.36 of the Microsoft Graph PowerShell SDK on March 12, 2026, and followed up with the V2.36.1 release on March 18, 2026. The list of changes published by Microsoft (for V2.36) isn’t earthshattering: most of the work seems to focus on smoothening the effects of the transition to using Web Account Manager as the default in V2.34. Other work was done to prepare for the new sovereign clouds like BleuCloud.
V2.36.1 contains a very important addition in support for Unified Tenant Configuration Management (UTCM). The APIs appeared at the start of February, and it takes a little time for the APIs to show up as cmdlets in the SDK. Unfortunately, a configuration issue (hilarious in itself) caused the UTCM module to be omitted from the V2.36 build. If you’re planning to upgrade, go ahead to V2.36.1. It’s usually best to stay current.
Getting back to what’s changed to improve the quality and stability of the Microsoft Graph PowerShell SDK, although it’s good to see some progress, the 13 changes listed in total for the V2.36 release have not moved the needle in terms of the 191 outstanding Microsoft Graph PowerShell SDK issues listed in GitHub. That’s a real pity.
The Microsoft Graph PowerShell SDK gets approximately 800,000 downloads, or around 5% of the total paid base for Microsoft 365 Copilot. Because the SDK is used for so many automation projects, it reaches far more than 16 million Microsoft 365 users. Although Microsoft derives no direct revenue from the SDK, it seems unreasonable to have just three people contribute to a release (which is what happened in V2.36 – the AutoRest process built the SDK module for UTCM). Having so few engineers work on an important component is an indication of how the demand for resources to work on AI-related topics has affected the progress and quality of the Microsoft Graph.
On to Next Month
There are always things to discuss about PowerShell. We’ll continue to add value to Automating Microsoft 365 with PowerShell with a update next month. Until then, happy scripting!
How to change the arrangement of plots in a tiled layout even if the plots are not empty?
Is is still not possible to change e.g. from horizontal to vertical arrangment? Why is this not comming?!Is is still not possible to change e.g. from horizontal to vertical arrangment? Why is this not comming?! Is is still not possible to change e.g. from horizontal to vertical arrangment? Why is this not comming?! tiledlayout MATLAB Answers — New Questions
How do I reduce the amount of vectors I get from the gradient function without compromising resolution?
The gradient function returns the gradient of a scalar function (in the 3-dimensional case) depending on z-values, which means the gradient is approximated. To get a better approximation it would be best to feed as much z-values into the gradient function as possible. The function returns a gradient vector for every z-value fed to the function. Wanting to visualize the gradient, this means that for higher resolution gradients a lot of vectors are generated, which can create cluttered visualization (i.e. figure 1, where the blue lines underneath the curve represent the gradient vectors).
Is it possible to reduce the amount of vectors returned by the gradient function to improve visualization?The gradient function returns the gradient of a scalar function (in the 3-dimensional case) depending on z-values, which means the gradient is approximated. To get a better approximation it would be best to feed as much z-values into the gradient function as possible. The function returns a gradient vector for every z-value fed to the function. Wanting to visualize the gradient, this means that for higher resolution gradients a lot of vectors are generated, which can create cluttered visualization (i.e. figure 1, where the blue lines underneath the curve represent the gradient vectors).
Is it possible to reduce the amount of vectors returned by the gradient function to improve visualization? The gradient function returns the gradient of a scalar function (in the 3-dimensional case) depending on z-values, which means the gradient is approximated. To get a better approximation it would be best to feed as much z-values into the gradient function as possible. The function returns a gradient vector for every z-value fed to the function. Wanting to visualize the gradient, this means that for higher resolution gradients a lot of vectors are generated, which can create cluttered visualization (i.e. figure 1, where the blue lines underneath the curve represent the gradient vectors).
Is it possible to reduce the amount of vectors returned by the gradient function to improve visualization? gradient, vectors MATLAB Answers — New Questions
system command error within a parfor
Hi all,
I’m getting this error when runnning the code below. I isolated the issue to the use of the system command within the parfor loop. Note however that the same exact code runs fine on another -windows- PC.
Error Identifier: MATLAB:parallel:future:FetchNextFutureErrored
Error Message: The function evaluation completed with an error.
parfor ……
…..
command = …;
system(command);
endHi all,
I’m getting this error when runnning the code below. I isolated the issue to the use of the system command within the parfor loop. Note however that the same exact code runs fine on another -windows- PC.
Error Identifier: MATLAB:parallel:future:FetchNextFutureErrored
Error Message: The function evaluation completed with an error.
parfor ……
…..
command = …;
system(command);
end Hi all,
I’m getting this error when runnning the code below. I isolated the issue to the use of the system command within the parfor loop. Note however that the same exact code runs fine on another -windows- PC.
Error Identifier: MATLAB:parallel:future:FetchNextFutureErrored
Error Message: The function evaluation completed with an error.
parfor ……
…..
command = …;
system(command);
end parallel computing, parfor, system MATLAB Answers — New Questions
Weird Behaviour of Parallel Processing when Using BlockProc
Hello, I a trying to speed up some analysis of an image (4700 v 128 pixels) that needs breaking up into smaller regions (20×128 pixels) and for each region having a calculation done such as the standard deviation (std2)
I thought the combination of Blockproc and the parallel toolbox would be ideal for this.
However, when I run my analysis, I sometmes get a fast completion time of 0.25s, but other times I run it it can take upto 3s.
1: When I start up my matlab session, i start a parallel pool:
% For parallel Processing (init parpool here)
delete(gcp(‘nocreate’)); % but delete any that are already running
c=parcluster(‘local’);
numwks=c.NumWorkers;
ReportMessage(app,[‘Parallel processing: NumWorkers = ‘,num2str(numwks)]);
parpool(‘Processes’,numwks);
p=gcp;
conn=p.Connected;
ReportMessage(app,[‘…Connected ‘,num2str(conn)]);
2: I then run my fucntion from a push button callback.
My function first gets an image off a uiaxes, crops it and then performs the blockproc.
% Fast Analysis (SD)
tstart=tic;
ax=app.UIAxes;
IM=getimage(ax);
[sy,sx]=size(IM);
xl=5950; xr=10680; yb=0; yt=0; dx=xr-xl; % This is for image cropping
rect=[xl, yb, xr-xl,sy-yt-yb]; %[x, y, width, height]
IM2=imcrop(IM,rect);
IM=IM2-min(IM2(:)); % Background subtract
[sy,sx]=size(IM);
ColSize=20; % Number of pixels in each ROI – 20 default
nCols=floor(sx/ColSize);
RowSize = 128;
%BlockProc with Parallel
bss = [RowSize,ColSize]; % Each blockproc region
fh = @(bs) std2(bs.data); % perform this on each block
J = blockproc(IM, bss, fh,’UseParallel’,true);
sd=J’; % Column vector
ReportMessage(app,num2str(toc(tstart)));
Is there something I am doing wrong? Do I need to close and reopen the parpool everytime or something.
Also, if I want the fh function to be a functio that has more than 1 argument, how do I do the syntax.
For example, I have a function (that works fine by itself)
Brenner=fmeasure(Image,’BREN’,[]); %Focus metric
And I have tried to call it into Blockproc via:
fh = @(bs) fmeasure(bs.data,’BREN’,[]);
It doesn’t work properly.Hello, I a trying to speed up some analysis of an image (4700 v 128 pixels) that needs breaking up into smaller regions (20×128 pixels) and for each region having a calculation done such as the standard deviation (std2)
I thought the combination of Blockproc and the parallel toolbox would be ideal for this.
However, when I run my analysis, I sometmes get a fast completion time of 0.25s, but other times I run it it can take upto 3s.
1: When I start up my matlab session, i start a parallel pool:
% For parallel Processing (init parpool here)
delete(gcp(‘nocreate’)); % but delete any that are already running
c=parcluster(‘local’);
numwks=c.NumWorkers;
ReportMessage(app,[‘Parallel processing: NumWorkers = ‘,num2str(numwks)]);
parpool(‘Processes’,numwks);
p=gcp;
conn=p.Connected;
ReportMessage(app,[‘…Connected ‘,num2str(conn)]);
2: I then run my fucntion from a push button callback.
My function first gets an image off a uiaxes, crops it and then performs the blockproc.
% Fast Analysis (SD)
tstart=tic;
ax=app.UIAxes;
IM=getimage(ax);
[sy,sx]=size(IM);
xl=5950; xr=10680; yb=0; yt=0; dx=xr-xl; % This is for image cropping
rect=[xl, yb, xr-xl,sy-yt-yb]; %[x, y, width, height]
IM2=imcrop(IM,rect);
IM=IM2-min(IM2(:)); % Background subtract
[sy,sx]=size(IM);
ColSize=20; % Number of pixels in each ROI – 20 default
nCols=floor(sx/ColSize);
RowSize = 128;
%BlockProc with Parallel
bss = [RowSize,ColSize]; % Each blockproc region
fh = @(bs) std2(bs.data); % perform this on each block
J = blockproc(IM, bss, fh,’UseParallel’,true);
sd=J’; % Column vector
ReportMessage(app,num2str(toc(tstart)));
Is there something I am doing wrong? Do I need to close and reopen the parpool everytime or something.
Also, if I want the fh function to be a functio that has more than 1 argument, how do I do the syntax.
For example, I have a function (that works fine by itself)
Brenner=fmeasure(Image,’BREN’,[]); %Focus metric
And I have tried to call it into Blockproc via:
fh = @(bs) fmeasure(bs.data,’BREN’,[]);
It doesn’t work properly. Hello, I a trying to speed up some analysis of an image (4700 v 128 pixels) that needs breaking up into smaller regions (20×128 pixels) and for each region having a calculation done such as the standard deviation (std2)
I thought the combination of Blockproc and the parallel toolbox would be ideal for this.
However, when I run my analysis, I sometmes get a fast completion time of 0.25s, but other times I run it it can take upto 3s.
1: When I start up my matlab session, i start a parallel pool:
% For parallel Processing (init parpool here)
delete(gcp(‘nocreate’)); % but delete any that are already running
c=parcluster(‘local’);
numwks=c.NumWorkers;
ReportMessage(app,[‘Parallel processing: NumWorkers = ‘,num2str(numwks)]);
parpool(‘Processes’,numwks);
p=gcp;
conn=p.Connected;
ReportMessage(app,[‘…Connected ‘,num2str(conn)]);
2: I then run my fucntion from a push button callback.
My function first gets an image off a uiaxes, crops it and then performs the blockproc.
% Fast Analysis (SD)
tstart=tic;
ax=app.UIAxes;
IM=getimage(ax);
[sy,sx]=size(IM);
xl=5950; xr=10680; yb=0; yt=0; dx=xr-xl; % This is for image cropping
rect=[xl, yb, xr-xl,sy-yt-yb]; %[x, y, width, height]
IM2=imcrop(IM,rect);
IM=IM2-min(IM2(:)); % Background subtract
[sy,sx]=size(IM);
ColSize=20; % Number of pixels in each ROI – 20 default
nCols=floor(sx/ColSize);
RowSize = 128;
%BlockProc with Parallel
bss = [RowSize,ColSize]; % Each blockproc region
fh = @(bs) std2(bs.data); % perform this on each block
J = blockproc(IM, bss, fh,’UseParallel’,true);
sd=J’; % Column vector
ReportMessage(app,num2str(toc(tstart)));
Is there something I am doing wrong? Do I need to close and reopen the parpool everytime or something.
Also, if I want the fh function to be a functio that has more than 1 argument, how do I do the syntax.
For example, I have a function (that works fine by itself)
Brenner=fmeasure(Image,’BREN’,[]); %Focus metric
And I have tried to call it into Blockproc via:
fh = @(bs) fmeasure(bs.data,’BREN’,[]);
It doesn’t work properly. parpool, blockproc, parallel computing toolbox MATLAB Answers — New Questions
Planner Agent Delivers AI Help for Tasks
Planner Agent Helps People Understand How to Get Tasks Done
Message center notification MC1250279 (12 March 2026, Microsoft 365 roadmap item 511820) announces that the Project Manager agent, part of Microsoft Planner, will be renamed to be the Planner agent. More importantly, the agent will be available to users with Microsoft 365 Copilot licenses who have either a Planner premium or Planner basic plan. Previously, the agent was confined to users with Planner premium licenses. Apparently, the move is all part of the grand plan to align naming and expand availability of Copilot services.
Targeted release tenants will see the change before the end of March 2026. My tenant is targeted and I see the agent show up in plan rosters. General availability is due to be completed by early May 2026.
How Does the Planner Agent Work?
The news about an agent renaming is exciting enough for one day. After calming down, I looked for the agent documentation and learned that the Planner agent is supposed to get work done faster and can “create your plan based on goals, execute tasks, and act on feedback.” Essentially, the Planner agent takes the details of a task and uses that information to generate an AI outline describing how to accomplish the task.
To invoke the agent, you create a task as normal and then assign the Planner agent to the task (Figure 1). Planner automatically adds the user that assigns the agent to “help review the response of the AI agent.”

Planner then queues the task for AI processing. After a couple of minutes, the task is picked up by a background task and processed. Planner uses a special label to indicate the state of processing. As you can see in Figure 1, a task starts out as Queued, then progresses to In Progress, and finally ends up as Ready. Task Assignees receive email to notify them when the Planner agent completes its processing.
Any of the plan members can see the advice generated by the Planner agent through the AI agent activity tab. Currently, the tab is not visible in the Planner mobile client, so you must use the browser client or Teams app to see the information. Figure 2 shows the Teams app being used to view the recommendations generated by the Planner agent.

Refining AI Recommendations
The recommendations generated by the Planner agent are in a Loop component. Given that the information provided to the agent in a task might not be complete, it’s likely that some further interaction is necessary to refine the recommendations to a point where they are valid, useful, and actionable.
Plan members can edit the Loop component through the task or using the Loop browser app. Figure 3 shows the recommendations for the task being edited in the Loop app. The advantage of using Loop to hold the agent recommendations is that Loop supports simultaneous edits to the information with near-instantaneous updates.

In this case, the input comes from a plan member who is not assigned to the task. Remember, all plan members have equal access to the tasks in a plan. If you want to keep something confidential, put it in a separate plan.
Regenerating Planner Agent Recommendations
At any point in the editing process, you can regenerate the AI recommendations. The same queueing process occurs to submit the updated information (from notes added for the task and the text in the Loop component) for processing. The Loop component is then refreshed with the updated recommendations. This sequence continues for as many iterations as necessary. Task chat (Figure 4) is usually helpful to resolve issues raised in the AI-generated text.

Hopefully, the final outcome is a helpful outline explaining how to achieve the task. The recommendations in the Loop component can be copied into a Word document, shared with other users, or printed as a PDF.
Precise Framing of Tasks is Critical
As always, the quality of the input determines the quality of the output. If a task is described in loose terms with no clear direction about what’s expected and no direction about restraints that need to be respected, the AI output will be bland, generic, and unhelpful. Precise framing of the task with some detailed notes about how to approach the work will give the Planner agent better guidance about what’s expected and the output shouldn’t be AI slop. Treat the agent output like you’d handle the work of a junior associate and be prepared to iterate to work to improve its output, and the Planner agent might just work for you.
Learn about managing Planner 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.
Announcing Copilot leadership update
Satya Nadella, Chairman and CEO, and Mustafa Suleyman, Executive Vice President and CEO of Microsoft AI, shared the below communications with Microsoft employees this morning.
SATYA NADELLA MESSAGE
I want to share two org changes we’re making to our Copilot org and superintelligence effort.
It’s clear a new era of productivity is emerging as AI experiences rapidly evolve from answering questions and suggesting code, to executing multi-step tasks with clear user control points. You see this in our announcements over the last couple of weeks, like Copilot Tasks and Copilot Cowork, agentic capabilities in Office, and Agent 365. As these experiences connect more naturally across agents, apps, and workflows, we have an opportunity to help customers spend more time on higher-value work and reduce manual coordination, while providing people with more agency and empowerment and organizations with the governance and security controls they need.
To that end, we are bringing the Copilot system across commercial and consumer together as one unified effort. This will span four connected pillars: Copilot experience, Copilot platform, Microsoft 365 apps, and AI models. This is how we move from a collection of great products to a truly integrated system, one that is simpler and more powerful for customers.
Jacob Andreou will lead the Copilot experience across consumer and commercial, driving design, product, growth, and engineering, as EVP, Copilot, reporting to me. As CVP of Product and Growth at Microsoft AI, Jacob has accelerated our user-focused AI-first product making and growth framework. Prior to that, he was SVP at Snap, where he helped scale the company from its early days.
Progress at the AI model layer is more critical than ever to our success as a company over the next decade and is foundational to everything we build above it. We are doubling down on our superintelligence mission with the talent and compute to build models that have real product impact, in terms of evals, COGS reduction, as well as advancing the frontier when it comes to meeting enterprise needs and achieving the next set of research breakthroughs. Mustafa Suleyman and I have been working towards this plan for some time, and he will continue to lead this high ambition work, reporting to me. Mustafa is uniquely qualified to drive this forward, with his deep focus and commitment to advancing the frontiers of model science, while also ensuring that human control, agency, and economic opportunity remain at the center of these advancements.
Ryan Roslansky, Perry Clarke, and Charles Lamanna will lead M365 apps and the Copilot platform. Together, Jacob, Ryan, Charles, Perry, and Mustafa make up the Copilot LT and over the next few weeks they’ll work to align the teams.
Our org boundaries will simply reflect system architecture and product shape such that we can deliver more coherent and competitive experiences that continue to evolve with model capabilities. And I am looking forward to how together we apply all of this to empower people, organizations, and the world.
MUSTAFA SULEYMAN MESSAGE
Subject: A new structure for Microsoft AI
Technology and the future of our industry will be defined by two things: frontier models, and the products through which they are experienced. For some time, I’ve been thinking about how we best tackle these huge challenges, and today I’m excited to be evolving our structure at Microsoft AI, ensuring we’re positioned to succeed in both.
I came to Microsoft with an overriding mission: to create Superintelligence that delivers a transformative, positive impact for millions of people. This requires us to build frontier models, at scale, pushing the boundaries of what’s possible. Everything else follows from this. It’s the foundation for our future as a company. With our ambitious, long-term frontier scale compute roadmap locked, we now have everything we need to build truly SOTA models.
As you will have just heard from Satya, the next phase of this plan is to restructure our organization to enable me to focus all my energy on our Superintelligence efforts and be able to deliver world class models for Microsoft over the next 5 years. These models will enable us to build enterprise tuned lineages that help improve all our products across the company. They’ll also enable us to deliver the COGS efficiencies necessary to be able to serve AI workloads at the immense scale required in the coming years. Achieving all this will be a huge challenge, and I’m committing everything we have – and I have personally – to make it happen.
To that end, I’ve been working hard with other leaders in the background for a while now to define a strategy to unify Copilot by bringing together the Consumer and Commercial efforts as one. We all know this makes sense. Every user – whether at home or at work – will be able to enjoy the full benefit of what we are all building. Today, we’re combining these organizations into a single, unified Copilot org. Jacob has demonstrated himself to be an outstanding leader for the product experience and clearly has the product instincts, the operational range, and the conviction to make Copilot a great success.
Jacob will retain a dotted line to me, and I’ll stay directly involved in much of the day-to-day operation of MAI, attending Meetups, MMMs, LT, and supporting Jacob to drive all areas of product strategy. To ensure that the models we build and the products we ship are mutually reinforcing, we are establishing a Copilot Leadership Team that includes me, Jacob, Charles Lamanna, Perry Clarke, and Ryan Roslansky. This will enable us to focus our brand strategy, our product roadmap, our models and our core infrastructure as one to deliver the best experiences possible for all our users.
Thank you for everything you’ve done over the last few years. I know how hard everyone has been pushing and the sacrifices many of you have made to help the company adapt to this new era.
We really do have an incredible opportunity to redefine Microsoft for this agentic revolution.
Mustafa’s mail has been edited slightly for external use.
The post Announcing Copilot leadership update appeared first on The Official Microsoft Blog.
Satya Nadella, Chairman and CEO, and Mustafa Suleyman, Executive Vice President and CEO of Microsoft AI, shared the below communications with Microsoft employees this morning. SATYA NADELLA MESSAGE I want to share two org changes we’re making to our Copilot org and superintelligence effort. It’s clear a new era of productivity is emerging as AI experiences…
The post Announcing Copilot leadership update appeared first on The Official Microsoft Blog.Read More
How to preserve the 3d plot box, when changing patch visibility.
I have a 3d plot with a collection of patches. If I set a subset of patches Visible attributes to ‘off’, the plot box is recomputed. How can I capture and preserve all aspects of the plot box so that the visible patches don’t jump around as other patches become visible or invisible.I have a 3d plot with a collection of patches. If I set a subset of patches Visible attributes to ‘off’, the plot box is recomputed. How can I capture and preserve all aspects of the plot box so that the visible patches don’t jump around as other patches become visible or invisible. I have a 3d plot with a collection of patches. If I set a subset of patches Visible attributes to ‘off’, the plot box is recomputed. How can I capture and preserve all aspects of the plot box so that the visible patches don’t jump around as other patches become visible or invisible. 3d plots, plot box, plot view MATLAB Answers — New Questions
MATLAB Coder generated MEX file throws an error that “Index exceeds matrix dimensions” although the code runs in MATLAB without error
I’m trying to use MATLAB Coder to generate C/C++ code for my MATLAB code. However, when I try to execute the MEX file generated by MATLAB Coder, it throws an error that for a specific variable that the index exceeds matrix dimensions:
>> myCode_mex
Index exceeds matrix dimensions. The array ‘A’ is empty and therefore has no valid indices.
The error stack points to the following MATLAB source code where I perform array extension:
n = length(A);
if n < buffSize
A(n+1) = data;
The same code however runs in MATLAB without any issues. Why does this happen?I’m trying to use MATLAB Coder to generate C/C++ code for my MATLAB code. However, when I try to execute the MEX file generated by MATLAB Coder, it throws an error that for a specific variable that the index exceeds matrix dimensions:
>> myCode_mex
Index exceeds matrix dimensions. The array ‘A’ is empty and therefore has no valid indices.
The error stack points to the following MATLAB source code where I perform array extension:
n = length(A);
if n < buffSize
A(n+1) = data;
The same code however runs in MATLAB without any issues. Why does this happen? I’m trying to use MATLAB Coder to generate C/C++ code for my MATLAB code. However, when I try to execute the MEX file generated by MATLAB Coder, it throws an error that for a specific variable that the index exceeds matrix dimensions:
>> myCode_mex
Index exceeds matrix dimensions. The array ‘A’ is empty and therefore has no valid indices.
The error stack points to the following MATLAB source code where I perform array extension:
n = length(A);
if n < buffSize
A(n+1) = data;
The same code however runs in MATLAB without any issues. Why does this happen? array, index, exceeds, matrix, matlab, coder, extension, ml, codegen MATLAB Answers — New Questions









