Category: News
Sending data using I2C on Simulink
I’m using Nucleo-G474RE to send a bit stream over Simulink, instead of receiving 24 bits on the oscilloscope i can read only 8 bits, which are supposed to be the 8 bits in the middle that have the address of the peripheral and the status of the I2C block gives me 516 which is not on the documentation from matlab.I’m using Nucleo-G474RE to send a bit stream over Simulink, instead of receiving 24 bits on the oscilloscope i can read only 8 bits, which are supposed to be the 8 bits in the middle that have the address of the peripheral and the status of the I2C block gives me 516 which is not on the documentation from matlab. I’m using Nucleo-G474RE to send a bit stream over Simulink, instead of receiving 24 bits on the oscilloscope i can read only 8 bits, which are supposed to be the 8 bits in the middle that have the address of the peripheral and the status of the I2C block gives me 516 which is not on the documentation from matlab. i2c, nucleo-g474re MATLAB Answers — New Questions
2D-3D image registration – COMPLETE 6D ESTIMATION
Hello everyone,
I am simulating a 2D–3D image registration pipeline for 6D motion estimation (3D translation + rotation) from two 2D X-ray projections, based on the following paper:
[1] Fu & Kuduvalli, “A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery,” Med. Phys., 2008.
The pipeline consists of:
Generating a 3D CT volume with known fiducials
Applying a known 6D rigid transformation to the CT
Generating two 2D projections (A and B)
Performing accurate 2D–2D registration between each X-ray and its corresponding DRR
Estimating the final 6D transformation using geometric back-projection / analytical decomposition (as described in the paper)
Problem Description
The 2D image registrations are accurate and stable (x, y, in-plane rotation, and roll are recovered correctly for both projections).
However, the final 6D estimation shows significant error, especially in:
Out-of-plane translation
Out-of-plane rotations
Because the 2D registrations behave as expected, I suspect the issue is in the geometric back-projection / 2D-to-3D decomposition step, rather than in the similarity metric or optimization.
Specifically, I am unsure whether:
My implementation of the analytical back-projection equations is correct
The projection geometry (scaling, sign conventions, coordinate frames) is consistent between the two views
Additional geometric constraints or assumptions are required for observability
What I Am Looking For
I would greatly appreciate any insights or suggestions on:
Correct implementation of 2D-to-3D geometric back-projection for dual-view registration
Common pitfalls in coordinate systems, scaling factors, or sign conventions
Whether a cone-beam vs. parallel-beam assumption materially affects the 6D solution
Any recommended validation or sanity checks for this type of pipeline
I have attached the MATLAB code below for reference.
Thank you very much for your time and support.
Reference
[1] Fu, D., & Kuduvalli, G. (2008). A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery. Medical Physics, 35(5), 2180–2194.Hello everyone,
I am simulating a 2D–3D image registration pipeline for 6D motion estimation (3D translation + rotation) from two 2D X-ray projections, based on the following paper:
[1] Fu & Kuduvalli, “A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery,” Med. Phys., 2008.
The pipeline consists of:
Generating a 3D CT volume with known fiducials
Applying a known 6D rigid transformation to the CT
Generating two 2D projections (A and B)
Performing accurate 2D–2D registration between each X-ray and its corresponding DRR
Estimating the final 6D transformation using geometric back-projection / analytical decomposition (as described in the paper)
Problem Description
The 2D image registrations are accurate and stable (x, y, in-plane rotation, and roll are recovered correctly for both projections).
However, the final 6D estimation shows significant error, especially in:
Out-of-plane translation
Out-of-plane rotations
Because the 2D registrations behave as expected, I suspect the issue is in the geometric back-projection / 2D-to-3D decomposition step, rather than in the similarity metric or optimization.
Specifically, I am unsure whether:
My implementation of the analytical back-projection equations is correct
The projection geometry (scaling, sign conventions, coordinate frames) is consistent between the two views
Additional geometric constraints or assumptions are required for observability
What I Am Looking For
I would greatly appreciate any insights or suggestions on:
Correct implementation of 2D-to-3D geometric back-projection for dual-view registration
Common pitfalls in coordinate systems, scaling factors, or sign conventions
Whether a cone-beam vs. parallel-beam assumption materially affects the 6D solution
Any recommended validation or sanity checks for this type of pipeline
I have attached the MATLAB code below for reference.
Thank you very much for your time and support.
Reference
[1] Fu, D., & Kuduvalli, G. (2008). A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery. Medical Physics, 35(5), 2180–2194. Hello everyone,
I am simulating a 2D–3D image registration pipeline for 6D motion estimation (3D translation + rotation) from two 2D X-ray projections, based on the following paper:
[1] Fu & Kuduvalli, “A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery,” Med. Phys., 2008.
The pipeline consists of:
Generating a 3D CT volume with known fiducials
Applying a known 6D rigid transformation to the CT
Generating two 2D projections (A and B)
Performing accurate 2D–2D registration between each X-ray and its corresponding DRR
Estimating the final 6D transformation using geometric back-projection / analytical decomposition (as described in the paper)
Problem Description
The 2D image registrations are accurate and stable (x, y, in-plane rotation, and roll are recovered correctly for both projections).
However, the final 6D estimation shows significant error, especially in:
Out-of-plane translation
Out-of-plane rotations
Because the 2D registrations behave as expected, I suspect the issue is in the geometric back-projection / 2D-to-3D decomposition step, rather than in the similarity metric or optimization.
Specifically, I am unsure whether:
My implementation of the analytical back-projection equations is correct
The projection geometry (scaling, sign conventions, coordinate frames) is consistent between the two views
Additional geometric constraints or assumptions are required for observability
What I Am Looking For
I would greatly appreciate any insights or suggestions on:
Correct implementation of 2D-to-3D geometric back-projection for dual-view registration
Common pitfalls in coordinate systems, scaling factors, or sign conventions
Whether a cone-beam vs. parallel-beam assumption materially affects the 6D solution
Any recommended validation or sanity checks for this type of pipeline
I have attached the MATLAB code below for reference.
Thank you very much for your time and support.
Reference
[1] Fu, D., & Kuduvalli, G. (2008). A fast, accurate, and automatic 2D–3D image registration for image-guided cranial radiosurgery. Medical Physics, 35(5), 2180–2194. registration, 2d-3d image registration, optimization, iterative joint optimization MATLAB Answers — New Questions
enforce smooth parameter variation in model fit across space
Genetic algorithm ga() was used to fit a model to data taken across 3D space.
In this problem, 6 parameters are fit for each spatial point, which takes up to 2 minutes on a laptop; there are 2000 points. Fitting the model to each and every point sequentially takes 1-2 days.
As a first-pass, each point was considered independently, even though the physics-based model parameters must vary smoothly over space. What is a computationally-efficient way to force this smooth spatial variation on all 6 parameters (ideally without requiring a supercomputer or several days of processing)?Genetic algorithm ga() was used to fit a model to data taken across 3D space.
In this problem, 6 parameters are fit for each spatial point, which takes up to 2 minutes on a laptop; there are 2000 points. Fitting the model to each and every point sequentially takes 1-2 days.
As a first-pass, each point was considered independently, even though the physics-based model parameters must vary smoothly over space. What is a computationally-efficient way to force this smooth spatial variation on all 6 parameters (ideally without requiring a supercomputer or several days of processing)? Genetic algorithm ga() was used to fit a model to data taken across 3D space.
In this problem, 6 parameters are fit for each spatial point, which takes up to 2 minutes on a laptop; there are 2000 points. Fitting the model to each and every point sequentially takes 1-2 days.
As a first-pass, each point was considered independently, even though the physics-based model parameters must vary smoothly over space. What is a computationally-efficient way to force this smooth spatial variation on all 6 parameters (ideally without requiring a supercomputer or several days of processing)? genetic algorithm, spatially varying coefficients, parameter estimation MATLAB Answers — New Questions
Error in importing YOLO ONNX model in MATLAB
I tried to import an YOLO ONNX model to MATLAB (I have the DeepLearning Toolbox installed), but got an error.
I created my ONNX model using the following python code:
from ultralytics import YOLO
YOLO("yolo_model.pt").export(
format="onnx", opset=12, simplify=True, dynamic=False, nms=False)
(I tried also with dynamic=True and without specifying opset arg but got same results)
On MATLAB I used this code to import the model:
modelPath = ‘yolo_model.onnx’;
net = importNetworkFromONNX(modelPath);
dummyInput = dlarray(rand(1, 3, 256, 256), ‘BCSS’);
net = initialize(net, dummyInput);
out = predict(net, dummyInput);
and got the following:
Warning:
Unable to import some ONNX operators, because they are not supported.
They have been replaced by placholder layers or by placeholder functions inside generated custom layers. To find the
placeholder layers, call the function findPlaceholderLayers on the returned object.
2 operator(s) : Attribute ‘atialias’ is not supported.
To import the ONNX network as a function, use importONNXFunction.
> In nnet.internal.cnn.onnx.importONNXNetwork>iWarnIfContainsPlaceholders (line 163)
In nnet.internal.cnn.onnx.importONNXNetwork>iHandleTranslationIssues (line 104)
In nnet.internal.cnn.onnx.importONNXNetwork (line 57)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Warning: Returning an uninitialized dlnetwork. Initialize the network by passing example input data to the initialized object function.
> In nnet.internal.cnn.onnx.importONNXNetwork>constructDlnetwork (line 93)
In nnet.internal.cnn.onnx.importONNXNetwork (line 62)
In nnet.internal.cnn.onnx.importNetworkFromONNX (line 13)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Error using dlnetwork/initialize (line 600)
Invalid network.
Error in LoadONNX (line 10)
net = initialize(net, dummyInput);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Layer ‘Reshape_To_ReshapeLayer1072’: Error using the predict function in layer yolo_model.Reshape_To_ReshapeLayer1072. The function threw an error and could not be executed.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in dlarray/reshape (line 40)
objdata = reshape(objdata, varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeGraph1066 (line 204)
Vars.x_model_10_m_m_0__9 = reshape(Vars.x_model_10_m_m_0__19, shape{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeFcn (line 190)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims, x_model_10_m_m_0__8NumDims,
x_model_10_m_m_0__13NumDims, state] = Reshape_To_ReshapeGraph1066(x_model_10_m_m_0__18, NumDims.x_model_10_m_m_0__18, Vars, NumDims, Training, params.State);
Error in yolo_model.Reshape_To_ReshapeLayer1072/predict (line 34)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims,
x_model_10_m_m_0__8NumDims, x_model_10_m_m_0__13NumDims] = Reshape_To_ReshapeFcn(x_model_10_m_m_0__18, x_model_10_m_m_0__18NumDims, onnxParams, ‘Training’, false, …
Please helpI tried to import an YOLO ONNX model to MATLAB (I have the DeepLearning Toolbox installed), but got an error.
I created my ONNX model using the following python code:
from ultralytics import YOLO
YOLO("yolo_model.pt").export(
format="onnx", opset=12, simplify=True, dynamic=False, nms=False)
(I tried also with dynamic=True and without specifying opset arg but got same results)
On MATLAB I used this code to import the model:
modelPath = ‘yolo_model.onnx’;
net = importNetworkFromONNX(modelPath);
dummyInput = dlarray(rand(1, 3, 256, 256), ‘BCSS’);
net = initialize(net, dummyInput);
out = predict(net, dummyInput);
and got the following:
Warning:
Unable to import some ONNX operators, because they are not supported.
They have been replaced by placholder layers or by placeholder functions inside generated custom layers. To find the
placeholder layers, call the function findPlaceholderLayers on the returned object.
2 operator(s) : Attribute ‘atialias’ is not supported.
To import the ONNX network as a function, use importONNXFunction.
> In nnet.internal.cnn.onnx.importONNXNetwork>iWarnIfContainsPlaceholders (line 163)
In nnet.internal.cnn.onnx.importONNXNetwork>iHandleTranslationIssues (line 104)
In nnet.internal.cnn.onnx.importONNXNetwork (line 57)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Warning: Returning an uninitialized dlnetwork. Initialize the network by passing example input data to the initialized object function.
> In nnet.internal.cnn.onnx.importONNXNetwork>constructDlnetwork (line 93)
In nnet.internal.cnn.onnx.importONNXNetwork (line 62)
In nnet.internal.cnn.onnx.importNetworkFromONNX (line 13)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Error using dlnetwork/initialize (line 600)
Invalid network.
Error in LoadONNX (line 10)
net = initialize(net, dummyInput);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Layer ‘Reshape_To_ReshapeLayer1072’: Error using the predict function in layer yolo_model.Reshape_To_ReshapeLayer1072. The function threw an error and could not be executed.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in dlarray/reshape (line 40)
objdata = reshape(objdata, varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeGraph1066 (line 204)
Vars.x_model_10_m_m_0__9 = reshape(Vars.x_model_10_m_m_0__19, shape{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeFcn (line 190)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims, x_model_10_m_m_0__8NumDims,
x_model_10_m_m_0__13NumDims, state] = Reshape_To_ReshapeGraph1066(x_model_10_m_m_0__18, NumDims.x_model_10_m_m_0__18, Vars, NumDims, Training, params.State);
Error in yolo_model.Reshape_To_ReshapeLayer1072/predict (line 34)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims,
x_model_10_m_m_0__8NumDims, x_model_10_m_m_0__13NumDims] = Reshape_To_ReshapeFcn(x_model_10_m_m_0__18, x_model_10_m_m_0__18NumDims, onnxParams, ‘Training’, false, …
Please help I tried to import an YOLO ONNX model to MATLAB (I have the DeepLearning Toolbox installed), but got an error.
I created my ONNX model using the following python code:
from ultralytics import YOLO
YOLO("yolo_model.pt").export(
format="onnx", opset=12, simplify=True, dynamic=False, nms=False)
(I tried also with dynamic=True and without specifying opset arg but got same results)
On MATLAB I used this code to import the model:
modelPath = ‘yolo_model.onnx’;
net = importNetworkFromONNX(modelPath);
dummyInput = dlarray(rand(1, 3, 256, 256), ‘BCSS’);
net = initialize(net, dummyInput);
out = predict(net, dummyInput);
and got the following:
Warning:
Unable to import some ONNX operators, because they are not supported.
They have been replaced by placholder layers or by placeholder functions inside generated custom layers. To find the
placeholder layers, call the function findPlaceholderLayers on the returned object.
2 operator(s) : Attribute ‘atialias’ is not supported.
To import the ONNX network as a function, use importONNXFunction.
> In nnet.internal.cnn.onnx.importONNXNetwork>iWarnIfContainsPlaceholders (line 163)
In nnet.internal.cnn.onnx.importONNXNetwork>iHandleTranslationIssues (line 104)
In nnet.internal.cnn.onnx.importONNXNetwork (line 57)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Warning: Returning an uninitialized dlnetwork. Initialize the network by passing example input data to the initialized object function.
> In nnet.internal.cnn.onnx.importONNXNetwork>constructDlnetwork (line 93)
In nnet.internal.cnn.onnx.importONNXNetwork (line 62)
In nnet.internal.cnn.onnx.importNetworkFromONNX (line 13)
In importNetworkFromONNX (line 77)
In LoadONNX (line 6)
Error using dlnetwork/initialize (line 600)
Invalid network.
Error in LoadONNX (line 10)
net = initialize(net, dummyInput);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Caused by:
Layer ‘Reshape_To_ReshapeLayer1072’: Error using the predict function in layer yolo_model.Reshape_To_ReshapeLayer1072. The function threw an error and could not be executed.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in dlarray/reshape (line 40)
objdata = reshape(objdata, varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeGraph1066 (line 204)
Vars.x_model_10_m_m_0__9 = reshape(Vars.x_model_10_m_m_0__19, shape{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in yolo_model.Reshape_To_ReshapeLayer1072>Reshape_To_ReshapeFcn (line 190)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims, x_model_10_m_m_0__8NumDims,
x_model_10_m_m_0__13NumDims, state] = Reshape_To_ReshapeGraph1066(x_model_10_m_m_0__18, NumDims.x_model_10_m_m_0__18, Vars, NumDims, Training, params.State);
Error in yolo_model.Reshape_To_ReshapeLayer1072/predict (line 34)
[x_model_10_m_m_0__11, x_model_10_m_m_0__12, x_model_10_m_m_0__8, x_model_10_m_m_0__13, x_model_10_m_m_0__11NumDims, x_model_10_m_m_0__12NumDims,
x_model_10_m_m_0__8NumDims, x_model_10_m_m_0__13NumDims] = Reshape_To_ReshapeFcn(x_model_10_m_m_0__18, x_model_10_m_m_0__18NumDims, onnxParams, ‘Training’, false, …
Please help onnx, yolo MATLAB Answers — New Questions
Microsoft Tenant-to-Tenant Migration Orchestrator
Why is Microsoft Getting into the Tenant-to-Tenant Migration Market

I’ve listened to many Microsoft presentations about tenant-to-tenant (T2T) migration over the years. Each time, Microsoft’s interest faded when they realized the complexities involved in moving information from one Microsoft 365 tenant to another. It’s not just the engineering work to build migration functionality. After all, Microsoft has probably moved more mailboxes into the cloud and around the cloud than any other company. The problems seemed to be with support. Rather, the lack of desire within Microsoft to be responsible for migration projects that can become very sticky and troublesome.
It seemed like Microsoft was happy to leave the difficulties involved in T2T to ISVs, many of whom like Quest, BitTitan, ShareGate, and AvePoint, have worked on T2T tools and techniques for years and have lots of experience in this area. Indeed, Microsoft’s T2T migration architecture model (from 2021) highlights the use of third-party tools to move data. But now we have the Migration Orchestrator (in preview), announced in MC1198079 (16 December 2025).
The Migration Orchestrator can move mailboxes, OneDrive for Business accounts, and Teams chats. Mailbox migration has existed for a while and can handle primary and archive mailboxes.
Licensing
ISVs charge for their T2T solutions, and so does Microsoft. User accounts involved in a migration need Microsoft 365 E3 or E5 licenses and a Cross-Tenant User Data Migration license is required for each account to move mailbox and/or OneDrive information.
PowerShell Driven Migration
It might surprise some, but the Migration Orchestrator is controlled by a set of Graph APIs accessed as Microsoft Graph PowerShell SDK cmdlets (in version 2.33) like New-MgBetaCrossTenantMigrationJob (submits a new migration job for processing).
The implementation doesn’t surprise me at all. T2T migration processes are usually carefully planned and executed with lots of up-front work like the cross-tenant identity mapping process that must be done before any migration jobs can be run. It might be nice to have a UX but given that T2T migration is not core Microsoft 365 functionality, it makes sense to run everything through PowerShell.
Downsides
Like any migration, some restrictions exist. Microsoft won’t move mailboxes if they’re covered by any sort of hold, so some up-front work might be needed to determine whether any holds exist for mailboxes that should move and if it’s possible to release those holds without losing data. Releasing mailboxes from eDiscovery holds is usually the hardest problem because the fact that mailboxes are held for eDiscovery is a good indicator that some ongoing investigations need the information.
Another issue is that only IPM (data visible to email clients) is moved. Anything stored in non-IPM folders like Teams compliance records is left behind. This is in line with the general stance that compliance data belongs to the tenant in which the records are generated.
Migration orchestrator doesn’t include a method to deal with messages and documents protected by sensitivity labels. The way sensitivity labels work, the labels from one tenant must be removed before items leave the source tenant. Microsoft deals with the issue in a rather old blog (2019). However, ISVs have worked out ways to migrate protected content, and this could be an important point to consider depending on how your tenant uses sensitivity labels.
Microsoft’s Big Advantage
The biggest thing going for the Migration Orchestrator is that the data it processes remains within Microsoft datacenters. There’s no need to move data out of a tenant to an intermediate location before moving the data back to the target tenant. Given the amount of information accumulated in mailboxes, OneDrive accounts, and Teams chat, the speed of migration is important, and you can’t go any faster than when information stays within Microsoft.
ISVs will hate that Microsoft has the speed advantage, but they’ll argue that a phased and controlled migration can accomplish the same goal, albeit slower. ISVs will also point out their ability to deal with different use cases, like protected documents. And ISVs will love that Microsoft has legitimized T2T as a valid approach for tenant splits, joins, and mergers, so everyone will be happy.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
How to specify constant vs unique parameters in System ID with multiple experiments?
For multiple experiments, I’d like to fit a simple process model where 2 poles (tp1, tp2) are the same for all experiments, but gain (Kp), zero (tz) and time delay (td) can be different for each experiment. Is there an elegant way to to this with the System Identification Toolbox? Each experiment comprises 2 time series: one forcing input & one response ouput.For multiple experiments, I’d like to fit a simple process model where 2 poles (tp1, tp2) are the same for all experiments, but gain (Kp), zero (tz) and time delay (td) can be different for each experiment. Is there an elegant way to to this with the System Identification Toolbox? Each experiment comprises 2 time series: one forcing input & one response ouput. For multiple experiments, I’d like to fit a simple process model where 2 poles (tp1, tp2) are the same for all experiments, but gain (Kp), zero (tz) and time delay (td) can be different for each experiment. Is there an elegant way to to this with the System Identification Toolbox? Each experiment comprises 2 time series: one forcing input & one response ouput. system identification, procest MATLAB Answers — New Questions
How to create a duplicate test case programmatically, just like copy/paste in the test manager under the same test suite.
Hello,
I am currently working with the Simulink Test Manager and need assistance with programmatically duplicating test cases within the same test suite, similar to the "copy/paste" functionality available in the Test Manager interface.
I have a test suite loaded, and I want to create new test cases by duplicating existing ones. The goal is to maintain all properties (including the scripts and variable definitions in the callback sections) and settings of the original test case in the new duplicates.
So far, I have tried to retrieve the existing test case I wish to duplicate into the workspace and used dot operations like copy and duplicate, but these methods did not work as expected. For example:
newTestCase = existingTestCase.copy;
newTestCase = existingTestCase.duplicate;
A follow-up question, is it possible to programmatically edit or modify the scripts written in the callback sections of test cases? I am looking to automate the process of creating multiple test cases based on an existing one that was manually created in the Test Manager.
If anyone has experience with this or can provide guidance on how to achieve this programmatically, I would greatly appreciate your help!
Thank youHello,
I am currently working with the Simulink Test Manager and need assistance with programmatically duplicating test cases within the same test suite, similar to the "copy/paste" functionality available in the Test Manager interface.
I have a test suite loaded, and I want to create new test cases by duplicating existing ones. The goal is to maintain all properties (including the scripts and variable definitions in the callback sections) and settings of the original test case in the new duplicates.
So far, I have tried to retrieve the existing test case I wish to duplicate into the workspace and used dot operations like copy and duplicate, but these methods did not work as expected. For example:
newTestCase = existingTestCase.copy;
newTestCase = existingTestCase.duplicate;
A follow-up question, is it possible to programmatically edit or modify the scripts written in the callback sections of test cases? I am looking to automate the process of creating multiple test cases based on an existing one that was manually created in the Test Manager.
If anyone has experience with this or can provide guidance on how to achieve this programmatically, I would greatly appreciate your help!
Thank you Hello,
I am currently working with the Simulink Test Manager and need assistance with programmatically duplicating test cases within the same test suite, similar to the "copy/paste" functionality available in the Test Manager interface.
I have a test suite loaded, and I want to create new test cases by duplicating existing ones. The goal is to maintain all properties (including the scripts and variable definitions in the callback sections) and settings of the original test case in the new duplicates.
So far, I have tried to retrieve the existing test case I wish to duplicate into the workspace and used dot operations like copy and duplicate, but these methods did not work as expected. For example:
newTestCase = existingTestCase.copy;
newTestCase = existingTestCase.duplicate;
A follow-up question, is it possible to programmatically edit or modify the scripts written in the callback sections of test cases? I am looking to automate the process of creating multiple test cases based on an existing one that was manually created in the Test Manager.
If anyone has experience with this or can provide guidance on how to achieve this programmatically, I would greatly appreciate your help!
Thank you create duplicate test case MATLAB Answers — New Questions
Matlab R2025b failed to lunch after installing on Debian 13 (Trixie)
I´ve tried to install Matlab R2025b on Debian 13. I could install it via this commands:
sudo unzip -XK matlab.zip -d matlab_install
cd matlab_install
sudo su
xhost +SI:localuser:root
sudo ./install
This mehod I´ve used for installing Matlab R2024b on Debian 12.
Matlab R2025b should support Debian 13 see here: https://de.mathworks.com/support/requirements/matlab-linux.html
Since no other older Matlab Version supports Debian 13 I had only the choice for Matlab R2025b.
The installation was fine, but when I lunch it from terminal via this command:
matlab
it opens the matlab porgramm looks like a normal start (left at the buttom of the matlab programm it says initializing…), but in a sudden it stops and printing this message:
Unable to communicate with required MathWorks services (error 5201)
For help with this issue, contact support:
https://www.mathworks.com/support/contact_us.html
Unable to launch MVM server: License Error: Licensing shutdown
When I search for an activation file like in the installed folder there isn´t anyone in /urs/local/MATLAB/R2025b/bin/glnxa64.
Has somebody managed to run matlab on Debian 13?
Thank you very much for you help in forward.I´ve tried to install Matlab R2025b on Debian 13. I could install it via this commands:
sudo unzip -XK matlab.zip -d matlab_install
cd matlab_install
sudo su
xhost +SI:localuser:root
sudo ./install
This mehod I´ve used for installing Matlab R2024b on Debian 12.
Matlab R2025b should support Debian 13 see here: https://de.mathworks.com/support/requirements/matlab-linux.html
Since no other older Matlab Version supports Debian 13 I had only the choice for Matlab R2025b.
The installation was fine, but when I lunch it from terminal via this command:
matlab
it opens the matlab porgramm looks like a normal start (left at the buttom of the matlab programm it says initializing…), but in a sudden it stops and printing this message:
Unable to communicate with required MathWorks services (error 5201)
For help with this issue, contact support:
https://www.mathworks.com/support/contact_us.html
Unable to launch MVM server: License Error: Licensing shutdown
When I search for an activation file like in the installed folder there isn´t anyone in /urs/local/MATLAB/R2025b/bin/glnxa64.
Has somebody managed to run matlab on Debian 13?
Thank you very much for you help in forward. I´ve tried to install Matlab R2025b on Debian 13. I could install it via this commands:
sudo unzip -XK matlab.zip -d matlab_install
cd matlab_install
sudo su
xhost +SI:localuser:root
sudo ./install
This mehod I´ve used for installing Matlab R2024b on Debian 12.
Matlab R2025b should support Debian 13 see here: https://de.mathworks.com/support/requirements/matlab-linux.html
Since no other older Matlab Version supports Debian 13 I had only the choice for Matlab R2025b.
The installation was fine, but when I lunch it from terminal via this command:
matlab
it opens the matlab porgramm looks like a normal start (left at the buttom of the matlab programm it says initializing…), but in a sudden it stops and printing this message:
Unable to communicate with required MathWorks services (error 5201)
For help with this issue, contact support:
https://www.mathworks.com/support/contact_us.html
Unable to launch MVM server: License Error: Licensing shutdown
When I search for an activation file like in the installed folder there isn´t anyone in /urs/local/MATLAB/R2025b/bin/glnxa64.
Has somebody managed to run matlab on Debian 13?
Thank you very much for you help in forward. debian13, linux, installation MATLAB Answers — New Questions
Statistics Toolbox is not getting installed with R2025a or R2025b
Our campus license includes the Statistics and Machine Learning Toolbox, but it is not getting installed with our installations of Matlab R2025a or R2025b. The %ProgramFiles%MatlabR2025atoolboxstats folder doesn’t get created and the component (though listed within Matlab) is not usable.
We are installing through Configuration Manager using an application built from the downloaded ISO. If I uninstall the toolbox manually and then reinstall it, the components are there (though I also have to manually reinstall all other toolboxes that are dependent on Statistics toolbox), so our license is obviously fine.Our campus license includes the Statistics and Machine Learning Toolbox, but it is not getting installed with our installations of Matlab R2025a or R2025b. The %ProgramFiles%MatlabR2025atoolboxstats folder doesn’t get created and the component (though listed within Matlab) is not usable.
We are installing through Configuration Manager using an application built from the downloaded ISO. If I uninstall the toolbox manually and then reinstall it, the components are there (though I also have to manually reinstall all other toolboxes that are dependent on Statistics toolbox), so our license is obviously fine. Our campus license includes the Statistics and Machine Learning Toolbox, but it is not getting installed with our installations of Matlab R2025a or R2025b. The %ProgramFiles%MatlabR2025atoolboxstats folder doesn’t get created and the component (though listed within Matlab) is not usable.
We are installing through Configuration Manager using an application built from the downloaded ISO. If I uninstall the toolbox manually and then reinstall it, the components are there (though I also have to manually reinstall all other toolboxes that are dependent on Statistics toolbox), so our license is obviously fine. statistics toolbox, installation problem MATLAB Answers — New Questions
Removing Retention Holds from Exchange Mailboxes
Set-Mailbox can Remove Retention Holds from Exchange Online Mailboxes
In 2019, I wrote about the ability to exclude inactive mailboxes from organization retention holds through the ExcludeFromOrgHolds and ExcludeFromAllOrgHolds parameters for the Set-Mailbox cmdlet. Exchange Online retains inactive mailboxes until the last hold is released, and some inactive mailboxes were lingering because of holds that could be removed without compromising any compliance requirement. The parameters allowed administrators to exclude inactive mailboxes from organization retention holds, meaning that Exchange Online could then remove the mailboxes if no further hold remained in place.
However, a bunch of other kinds of holds can prevent Exchange Online from removing inactive mailboxes, including eDiscovery holds, litigation holds, retention policies applied at the mailbox level, and the presence of Microsoft 365 retention labels or Exchange compliance tags within the mailbox. Then there’s temporary delay holds and delay release holds and maybe even “orphan” holds where policies have been removed but holds remain in place. All in all, removing everything that could stop Exchange Online deleting an inactive mailbox is a complex business.
The ExcludeFromAllHolds Parameter
Which brings us to the December 10 announcement of the ExcludeFromAllHolds parameter, which is designed to remove some of the blocking holds for inactive mailboxes (and inactive mailboxes too). which is designed to remove some of the holds that block the removal inactive mailboxes (and inactive mailboxes too). The new capability covers removal of holds imposed by organization retention policies, user-level retention policies, retention labels and compliance tags, and delay holds. The remaining hold types, like eDiscovery or litigation holds, exist for compliance purposes rather than retention processing, and are out of scope. The feature is also described in MC1194077 and Microsoft 365 roadmap item 537204.
Importantly, removing mailboxes from retention processing does not affect Microsoft 365 retention policies or Exchange Online MRM policies. Instead, mailboxes are marked with an exclusion so that when the Managed Folder Assistant applies retention to the mailboxes, it knows that specific policies should be excluded from its calculations. The presence of exclusions is noted in a mailbox’s InPlaceHolds property, where the identifiers for the excluded policies are marked with a -mbx prefix.
Tracking down holds that apply to mailboxes is simple enough. Discovering if labels or tags are used within a mailbox is difficult. For that reason, Microsoft provides the RemoveComplianceTagHoldApplied switch to only remove holds imposed by retention labels and compliance tags.
Set-Mailbox -Identity Marty.King -RemoveComplianceTagHoldApplied -ProvideConsent
The ProvideConsent switch must be used with active mailboxes as an acknowledgement that removing holds might result in data being removed from the mailbox. The switch isn’t needed with inactive mailboxes.
Testing Removing Holds
My tenant (small and mostly used for testing) reports 51 inactive mailboxes. Some of the mailboxes are user mailboxes, some are shared mailboxes. Many of the mailboxes have exclusions created for organization-wide policies and remain in place because of some other hold. Because I clean up eDiscovery cases regularly, most of the inactive mailboxes remain due to the presence of retention labels or compliance tags in the mailbox.
[array]$InactiveMailboxes = Get-ExoMailbox -InactiveMailboxOnly -ResultSize Unlimited -Properties WhenCreated | Sort-Object WhenCreated -Descending $InactiveMailboxes.count 51
Releasing Retention Holds to Remove an Inactive Mailbox
Here’s an example of removing holds from an inactive mailbox. First, we check what holds exist. Apart from one “Uni” (eDiscovery) hold, the other seven holds are prefixed with “mbx,” so they refer to Microsoft 365 retention policies applied to mailboxes. However, there’s a minus sign preceding each prefix, so that means that these are holds that the mailbox is excluded from.
Get-Mailbox -InactiveMailboxOnly -Identity TPerham | Select-Object -ExpandProperty InPlaceHolds -mbx95c7ff3a9a344cb49b4116180c9e975a -mbx85eb38087b2642619b79161788f5b81b -mbxf6a1654abdba4712a43c354e28a4d56c -mbx703105e3b8804a1093bb5cb777638ea8 -mbxc1e2d6f1785d4bf8a7746a26e58e5f66 -mbx9696959111f74ecda8a40aef97edd2c2 -mbx19200b9af08442529be070dae2fd54d3 UniH4001d1c2-9438-4e46-9d14-80207a8099e9
Let’s go ahead and run Set-Mailbox to remove the holds:
Set-Mailbox -Identity TPerham -ExcludeFromAllHolds WARNING: Excluding 1 organization-level policies from mailbox Soft Deleted ObjectsTPerham: mbx1c33dc0f078f4d12b7299c8a5b748708:3 WARNING: Excluding 4 user-level policies from mailbox Soft Deleted ObjectsTPerham: UniH4001d1c2-9438-4e46-9d14-80207a8099e9, 4001d1c2-9438-4e46-9d14-80207a8099e9, 1c33dc0f-078f-4d12-b729-9c8a5b748708, d3330e0c-9e7b-45f5-8986-a274589ecef9 WARNING: Successfully excluded mailbox Soft Deleted ObjectsTPerham from 5 holds. Added 10 exemption entries.
If we check the mailbox again, the number of hold exclusions has grown to 10. The eDiscovery hold is still in place, so the mailbox remains in an inactive state.
Get-Mailbox -InactiveMailboxOnly -Identity TPerham | Select-Object -ExpandProperty InPlaceHolds -mbxd3330e0c9e7b45f58986a274589ecef9 -mbx4001d1c294384e469d1480207a8099e9 -mbx1c33dc0f078f4d12b7299c8a5b748708 -mbx95c7ff3a9a344cb49b4116180c9e975a -mbx85eb38087b2642619b79161788f5b81b -mbxf6a1654abdba4712a43c354e28a4d56c -mbx703105e3b8804a1093bb5cb777638ea8 -mbxc1e2d6f1785d4bf8a7746a26e58e5f66 -mbx9696959111f74ecda8a40aef97edd2c2 -mbx19200b9af08442529be070dae2fd54d3 UniH4001d1c2-9438-4e46-9d14-80207a8099e9
If the cmdlet can remove all holds, the inactive mailbox becomes a soft-deleted mailbox and will eventually be removed. Here’s an example of when an inactive mailbox is excluded from all holds and becomes a soft-deleted mailbox:
Set-Mailbox -Identity Ann.Conroy -ExcludeFromAllHolds
WARNING: Excluding 1 organization-level policies from mailbox Soft Deleted Objectsf8b863a0-01fc-4c2e-beff-eb64484cc83d: mbx1c33dc0f078f4d12b7299c8a5b748708:3
WARNING: Excluding 2 user-level policies from mailbox Soft Deleted Objectsf8b863a0-01fc-4c2e-beff-eb64484cc83d: 1c33dc0f-078f-4d12-b729-9c8a5b748708, d3330e0c-9e7b-45f5-8986-a274589ecef9
WARNING: Successfully excluded mailbox Soft Deleted Objectsf8b863a0-01fc-4c2e-beff-eb64484cc83d from 3 holds. Added 2 exemption entries
Get-Mailbox -SoftDeletedMailbox -Identity Ann.Conroy | Format-List DisplayName, IsInactiveMailbox, WasInactiveMailbox, InPlaceHolds
DisplayName : Ann Conroy (GM Datacenters)
IsInactiveMailbox : False
WasInactiveMailbox : True
InPlaceHolds : {-mbxd3330e0c9e7b45f58986a274589ecef9, -mbx1c33dc0f078f4d12b7299c8a5b748708}
I wrote a script (available from GitHub) to clean up the set of inactive mailboxes by excluding all holds. The script reduced the number of inactive mailboxes from 51 to 12, all of which are held by an eDiscovery case.

Removing Holds from Group Mailboxes and Other Objects
The article describes how to exclude holds for deleted group mailboxes and other objects. However, but I hit issues with some group mailboxes. The error seems misleading because litigation hold was not enabled for the mailbox.
Set-Mailbox -Identity euroengage -GroupMailbox -ExcludeFromAllHolds -InactiveMailbox Set-Mailbox: ||You cannot change any setting except LitigationHoldEnabled and LitigationHoldDuration on an inactive mailbox.
Need to Test Removing Holds
As you’ve probably guessed, there’s no UX for this feature. Everything is done through PowerShell.
Obviously, any time that a hold expires or otherwise loses its grip over retained data, the risk exists that a background process will clean up and remove data permanently. For this reason, it’s wise to test features like the ExcludeAllHolds parameter to make sure it does what you think it should do and is then incorporated into tenant mailbox management processes with the approval of compliance managers.
Insight like this doesn’t come easily. You’ve got to know the technology and understand how to look behind the scenes. Benefit from the knowledge and experience of the Office 365 for IT Pros team by subscribing to the best eBook covering Office 365 and the wider Microsoft 365 ecosystem.
Fitting to exp plus a constant
Hello, I am trying to fit some data to an exponential + constant function and have this approach that I came across:
% code is giving good results with template equation : % y = a.*(1-exp(b.*(x-c))) + d;
f = @(a,b,c,d,x) a.*(1-exp(b.*(x-c))) + d;
obj_fun = @(params) norm(f(params(1), params(2), params(3), params(4),x)-y);
sol = fminsearch(obj_fun, [y(end)-y(1),0,0,y(1)]);
a_sol = sol(1);
b_sol = sol(2);
c_sol = sol(3);
d_sol = sol(4);
y_fit = f(a_sol, b_sol,c_sol ,d_sol, x);
figure
plot(x,y,’-+b’,x,y_fit,’-r’); grid on;
legend(‘signal’,’aexp(b(x-c))+d’);
title([‘a=’,num2str(a_sol,’%0.2f’), ‘ b=’,num2str(b_sol),’ c=’,num2str(c_sol),’ d=’,num2str(d_sol)],’FontSize’,14,’Color’,’b’)
Whilst the fit is good, the value of "a" seems wrong (at the expense of "d")
I’ve tried another approach that I came across from Steven Lord (as i don’t really understand the code above)
D=[x y]
% It would be better to parametrize the function as
xmin=min(x);
fitfun = fittype( @(a,b,c,x) a*exp(b*(x-xmin))+c );
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
plot(fitted_curve,’r-‘)
But I get this error:
Error using fit>iFit (line 362)
Inf computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients.
Error in fit (line 117)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, …
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in PlotAnalysis/FitExp1ContstantButtonPushed (line 1361)
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Hello, I am trying to fit some data to an exponential + constant function and have this approach that I came across:
% code is giving good results with template equation : % y = a.*(1-exp(b.*(x-c))) + d;
f = @(a,b,c,d,x) a.*(1-exp(b.*(x-c))) + d;
obj_fun = @(params) norm(f(params(1), params(2), params(3), params(4),x)-y);
sol = fminsearch(obj_fun, [y(end)-y(1),0,0,y(1)]);
a_sol = sol(1);
b_sol = sol(2);
c_sol = sol(3);
d_sol = sol(4);
y_fit = f(a_sol, b_sol,c_sol ,d_sol, x);
figure
plot(x,y,’-+b’,x,y_fit,’-r’); grid on;
legend(‘signal’,’aexp(b(x-c))+d’);
title([‘a=’,num2str(a_sol,’%0.2f’), ‘ b=’,num2str(b_sol),’ c=’,num2str(c_sol),’ d=’,num2str(d_sol)],’FontSize’,14,’Color’,’b’)
Whilst the fit is good, the value of "a" seems wrong (at the expense of "d")
I’ve tried another approach that I came across from Steven Lord (as i don’t really understand the code above)
D=[x y]
% It would be better to parametrize the function as
xmin=min(x);
fitfun = fittype( @(a,b,c,x) a*exp(b*(x-xmin))+c );
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
plot(fitted_curve,’r-‘)
But I get this error:
Error using fit>iFit (line 362)
Inf computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients.
Error in fit (line 117)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, …
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in PlotAnalysis/FitExp1ContstantButtonPushed (line 1361)
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Hello, I am trying to fit some data to an exponential + constant function and have this approach that I came across:
% code is giving good results with template equation : % y = a.*(1-exp(b.*(x-c))) + d;
f = @(a,b,c,d,x) a.*(1-exp(b.*(x-c))) + d;
obj_fun = @(params) norm(f(params(1), params(2), params(3), params(4),x)-y);
sol = fminsearch(obj_fun, [y(end)-y(1),0,0,y(1)]);
a_sol = sol(1);
b_sol = sol(2);
c_sol = sol(3);
d_sol = sol(4);
y_fit = f(a_sol, b_sol,c_sol ,d_sol, x);
figure
plot(x,y,’-+b’,x,y_fit,’-r’); grid on;
legend(‘signal’,’aexp(b(x-c))+d’);
title([‘a=’,num2str(a_sol,’%0.2f’), ‘ b=’,num2str(b_sol),’ c=’,num2str(c_sol),’ d=’,num2str(d_sol)],’FontSize’,14,’Color’,’b’)
Whilst the fit is good, the value of "a" seems wrong (at the expense of "d")
I’ve tried another approach that I came across from Steven Lord (as i don’t really understand the code above)
D=[x y]
% It would be better to parametrize the function as
xmin=min(x);
fitfun = fittype( @(a,b,c,x) a*exp(b*(x-xmin))+c );
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
plot(fitted_curve,’r-‘)
But I get this error:
Error using fit>iFit (line 362)
Inf computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients.
Error in fit (line 117)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, …
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in PlotAnalysis/FitExp1ContstantButtonPushed (line 1361)
[fitted_curve,gof] = fit(D(:,1),D(:,2),fitfun,’StartPoint’,[max(y) -2 min(y)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fit, fminsearch, fittype MATLAB Answers — New Questions
Why will MATLAB not start up properly on macOS?
Why will MATLAB not start up properly on my Mac?Why will MATLAB not start up properly on my Mac? Why will MATLAB not start up properly on my Mac? MATLAB Answers — New Questions
Find position of cell array within another cell array or table or in a structure
I have a number of nodes on a graph and a number of edges that connect them. Attached to each edge is a structure wear the first field is the EndNodes data from the edge table which defines the edges. I want to search the struct array to find the structure that matches the selected edge EndNodes but I can’t figure out the syntax. The closest I’ve come is something like this where EdgeData is the struct array and data is the 2×1 cell containing the desired EndNodes:
selectedEdge=EdgeData(ismember(data,array2table({app.EdgeData.EndNodes}).Var1))
This fails because the inputs of ismember must be character arrays rather than cell arrays containing character arrays. Concatenating them could work but I would then simply be detecting if the two names of the edges are present and not whether they are contained together within one field. I’ve tried ==, ismember, strcmp, isequal and I’ve run out of things to try and ideas of documentation to comb through. It’s possible that arrayfun might be the way forward but I don’t really understand it honestly
PS yes I’m using app designer hence the referencing of EdgeData as a propertyI have a number of nodes on a graph and a number of edges that connect them. Attached to each edge is a structure wear the first field is the EndNodes data from the edge table which defines the edges. I want to search the struct array to find the structure that matches the selected edge EndNodes but I can’t figure out the syntax. The closest I’ve come is something like this where EdgeData is the struct array and data is the 2×1 cell containing the desired EndNodes:
selectedEdge=EdgeData(ismember(data,array2table({app.EdgeData.EndNodes}).Var1))
This fails because the inputs of ismember must be character arrays rather than cell arrays containing character arrays. Concatenating them could work but I would then simply be detecting if the two names of the edges are present and not whether they are contained together within one field. I’ve tried ==, ismember, strcmp, isequal and I’ve run out of things to try and ideas of documentation to comb through. It’s possible that arrayfun might be the way forward but I don’t really understand it honestly
PS yes I’m using app designer hence the referencing of EdgeData as a property I have a number of nodes on a graph and a number of edges that connect them. Attached to each edge is a structure wear the first field is the EndNodes data from the edge table which defines the edges. I want to search the struct array to find the structure that matches the selected edge EndNodes but I can’t figure out the syntax. The closest I’ve come is something like this where EdgeData is the struct array and data is the 2×1 cell containing the desired EndNodes:
selectedEdge=EdgeData(ismember(data,array2table({app.EdgeData.EndNodes}).Var1))
This fails because the inputs of ismember must be character arrays rather than cell arrays containing character arrays. Concatenating them could work but I would then simply be detecting if the two names of the edges are present and not whether they are contained together within one field. I’ve tried ==, ismember, strcmp, isequal and I’ve run out of things to try and ideas of documentation to comb through. It’s possible that arrayfun might be the way forward but I don’t really understand it honestly
PS yes I’m using app designer hence the referencing of EdgeData as a property struct, structures, array, arrays, cell, cell array, cell arrays, ismember, table, data, string MATLAB Answers — New Questions
How to identify a thin line in a noisy sideview picture?
I have a set of binarized pictures (like the following one) of the water surface in a small portion of flume, taken during a laboratory experiment. The water surface is represented by the thin curved line, but as you can see the picture is "corrupted" by other big white patches representing light reflections on the flume glass walls, that I could not get rid of.
I am working on a script that tries to detect the position of the water surface and fits it with a spline. I tried to remove the extra patches by filtering them by area (i.e. by removing the patches with pixel area lower than a threshold) before fitting the spline; but I am stuck because for many pictures the area of the water surface patch is roughly the same as those of the extra patches, so they are both removed by the filter. Moreover, occasionally the extra patches intersect the surface patch, as is the case in the picture below.
Can you help me figuring out a method to fit a curve to identify the surface, that is as less sensitive as possible to the presence of the extra patches? Thank you.I have a set of binarized pictures (like the following one) of the water surface in a small portion of flume, taken during a laboratory experiment. The water surface is represented by the thin curved line, but as you can see the picture is "corrupted" by other big white patches representing light reflections on the flume glass walls, that I could not get rid of.
I am working on a script that tries to detect the position of the water surface and fits it with a spline. I tried to remove the extra patches by filtering them by area (i.e. by removing the patches with pixel area lower than a threshold) before fitting the spline; but I am stuck because for many pictures the area of the water surface patch is roughly the same as those of the extra patches, so they are both removed by the filter. Moreover, occasionally the extra patches intersect the surface patch, as is the case in the picture below.
Can you help me figuring out a method to fit a curve to identify the surface, that is as less sensitive as possible to the presence of the extra patches? Thank you. I have a set of binarized pictures (like the following one) of the water surface in a small portion of flume, taken during a laboratory experiment. The water surface is represented by the thin curved line, but as you can see the picture is "corrupted" by other big white patches representing light reflections on the flume glass walls, that I could not get rid of.
I am working on a script that tries to detect the position of the water surface and fits it with a spline. I tried to remove the extra patches by filtering them by area (i.e. by removing the patches with pixel area lower than a threshold) before fitting the spline; but I am stuck because for many pictures the area of the water surface patch is roughly the same as those of the extra patches, so they are both removed by the filter. Moreover, occasionally the extra patches intersect the surface patch, as is the case in the picture below.
Can you help me figuring out a method to fit a curve to identify the surface, that is as less sensitive as possible to the presence of the extra patches? Thank you. image processing, digital image processing MATLAB Answers — New Questions
Matalb compiled App crash on plotting while code version runs correctly
Hello,
I have an App which works well when running it from Matlab and I compiled it as a standalone application (it is intended to be delivered to a customer). But then the compiled App starts well (basically at opening it draws an Earth) and then i try to read a set of files with data and after some computation it is supposed to draw iso-contours (done by contourf) but instead it closes abruptally – no message in the log, no clue.
Any idea how to progress on that ?
Thanks in advance,
BertrandHello,
I have an App which works well when running it from Matlab and I compiled it as a standalone application (it is intended to be delivered to a customer). But then the compiled App starts well (basically at opening it draws an Earth) and then i try to read a set of files with data and after some computation it is supposed to draw iso-contours (done by contourf) but instead it closes abruptally – no message in the log, no clue.
Any idea how to progress on that ?
Thanks in advance,
Bertrand Hello,
I have an App which works well when running it from Matlab and I compiled it as a standalone application (it is intended to be delivered to a customer). But then the compiled App starts well (basically at opening it draws an Earth) and then i try to read a set of files with data and after some computation it is supposed to draw iso-contours (done by contourf) but instead it closes abruptally – no message in the log, no clue.
Any idea how to progress on that ?
Thanks in advance,
Bertrand compiled app crash 2024b MATLAB Answers — New Questions
SharePoint Online Expands Version Expiration for Audio and Video Files
Specific Version Expiration for Large Files to Save Valuable SharePoint Storage Quota
In their 12 December 2025 announcement (MC1194603), Microsoft doesn’t explain why they are introducing specific version expiration for audio and video files, Reading between the lines, this is an initiative allied with the introduction of intelligent versioning in 2024 to save some expensive SharePoint Online storage quota by automatically removing versions of Office files that aren’t needed for restore.
This time, the focus is on removing audio and video files because these files tend to be large and any editing done generates versions (new files) of the same size or larger. Given that Clipchamp is now widely available to Microsoft 365 users and can store its output in SharePoint Online and OneDrive for Business, focusing on audio and video file versions seems like a good idea.
The update is rolling out now and should reach all tenants worldwide by mid-January 2026. Like the introduction of many other SharePoint Online controls in the past, the method to apply and manage the “version expiration policies” is cmdlets from the SharePoint Online management PowerShell module. (Microsoft.Online.SharePoint.PowerShell). Before starting, I updated the module to version 16.0.26712.12000 as instructed in MC1194603.
Automatic or Manual Versioning
Not every tenant has adopted the idea behind intelligent versioning. Essentially, intelligent versioning “trims” file versions that SharePoint Online doesn’t consider necessary for restores. Just in case, SharePoint Online keeps the marked versions around for a period, but when that period elapses, SharePoint Online removes the unnecessary file versions. The only problem is that the desire to remove unwanted versions runs contrary to a separate need for retention. If retention policies place holds on site information, SharePoint cannot remove the unwanted versions.
The value of automatic version expiration is easily understood by reviewing the version history of a file that is frequently edited. Take the example in Figure 1, now at version 512. Each version is 2 MB, so if 500 versions are retained, they occupy 1,000 MB. You can also see that intelligent versioning has marked some versions to be removed in the short term (11 days), others to be kept for longer, and others to never expire at present because these versions are needed for restore. Removing all the unwanted versions saves a lot of storage.

The alternative to intelligent versioning is the traditional method based on keeping file versions under a preset threshold. In other words, instruct SharePoint to keep file versions under a certain limit, like 500, and remove file versions when necessary to stay under the limit.
Automatic Configuration
Configuration for version expiration policies is possible at the tenant, site, and document library (list) level. For example, to configure automatic version expiration, use the Set-SPOTenant cmdlet. This command enables automatic trimming for video, audio, and PST files:
[array]$FileTypes = "Video", "Audio","OutlookPST" Set-SPOTenant -EnableAutoExpirationVersionTrim $true -FileTypesForVersionExpiration $FileTypes
The Set-SPOSite cmdlet controls the equivalent settings for a site. In this example, the switch to ensure that new document libraries comply with the policy is set:
$SiteURL = https://office365itpros.sharepoint.com/sites/BlogsAndProjects
Set-SPOSite -Identity $SiteURL -EnableAutoExpirationVersionTrim $true -FileTypesForVersionExpiration $FileTypes -ApplyToNewDocumentLibraries
Confirm
Are you sure you want to perform this action?
The setting for new document libraries takes effect immediately. Please run Get-SPOSite to check the newly set values
on properties EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersionLimit.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Get-SPOSite -Identity $SiteURL | Format-Table EnableAutoExpirationVersionTrim, ExpireVersionsAfterDays, MajorVersionLimit
EnableAutoExpirationVersionTrim ExpireVersionsAfterDays MajorVersionLimit
------------------------------- ----------------------- -----------------
True
Finally, the Set-SPOLIstVersionPolicy cmdlet controls the setting for a document library:
Set-SPOListVersionPolicy -Site $SiteURL -List "Microsoft Press" -EnableAutoExpirationVersionTrim $true -FileTypes $FileTypes
Running the Get-SPOListVersionPolicy cmdlet afterwards shows the list of file types being managed in the VersionPolicyFileTypeOverride property.
Get-SPOListVersionPolicy -Site $SiteURL -List "Microsoft Press"
Changes made to policies affect future files, sites, and document libraries. To enforce the new settings on an existing document library, use the New-SPOListFileVersionBatchDeleteJob cmdlet to create a background job to process files:
New-SPOListFileVersionBatchDeleteJob -Site $SiteURL -List "Documents" -TrimUseListPolicy
Documentation Coming Soon
Microsoft says that “Before rollout, we will update this post with new documentation.” Apart from updated cmdlet documentation, no other words of wisdom about the use of file version expiration policies haven’t yet turned up, but I am sure that the documentation is on the way.
In the interim, as with any new feature that might impact compliance processes and procedures, it’s wise to review what file version expiration policies do and if they’ll work for you. Not everyone stores large audio and video files in document libraries and many of those files are never edited, so the question of file versions might not arise for your tenant. But if you’re in the business of working with audio and video files stored in SharePoint Online, as with Clipchamp, this feature could save your tenant some valuable SharePoint storage quota.
So much change, all the time. It’s a challenge to stay abreast of all the updates Microsoft makes across the Microsoft 365 ecosystem. Subscribe to the Office 365 for IT Pros eBook to receive insights updated monthly into what happens within Microsoft 365, why it happens, and what new features and capabilities mean for your tenant.
How to download the certificate
Buenos días
Acabé el curso de Simulink Onramp en línea; pero no me deja descargar el certificado; al abrir nuevamente me sale 0% de realización. Si le coloco realizar el curso en línea si me sale el 100% realizado. Su gentil ayuda por favor.
Atentamente
Carlos Tomalá
Good morning. I finished the Simulink OnRamp online course, but I can’t download the certificate. When I open it again, it shows 0% completion. If I select "complete the course online," it shows 100% completion. Your kind assistance would be greatly appreciated.
Sincerely, Carlos TomaláBuenos días
Acabé el curso de Simulink Onramp en línea; pero no me deja descargar el certificado; al abrir nuevamente me sale 0% de realización. Si le coloco realizar el curso en línea si me sale el 100% realizado. Su gentil ayuda por favor.
Atentamente
Carlos Tomalá
Good morning. I finished the Simulink OnRamp online course, but I can’t download the certificate. When I open it again, it shows 0% completion. If I select "complete the course online," it shows 100% completion. Your kind assistance would be greatly appreciated.
Sincerely, Carlos Tomalá Buenos días
Acabé el curso de Simulink Onramp en línea; pero no me deja descargar el certificado; al abrir nuevamente me sale 0% de realización. Si le coloco realizar el curso en línea si me sale el 100% realizado. Su gentil ayuda por favor.
Atentamente
Carlos Tomalá
Good morning. I finished the Simulink OnRamp online course, but I can’t download the certificate. When I open it again, it shows 0% completion. If I select "complete the course online," it shows 100% completion. Your kind assistance would be greatly appreciated.
Sincerely, Carlos Tomalá certificado simulink MATLAB Answers — New Questions
Using fprintf for complex numbers
Hi, I have
Z1= sqrt(3) * exp((pi*i)/4)
Z2= 2 * exp((pi*i)/6)
Z3= sqrt(3) * exp((3*pi*i)/4)
Z4= 2 * exp(pi*i)
Z5= 2 * exp(-pi*i)
And I would like something like
Real Complex
Z1 1.2247 + 1.2247i
Z2 1.7321 + 1.0000i
Z3 -1.2247 + 1.2247i
Z4 -2.0000 + 0.0000i
Z5 -2.0000 – 0.0000i
Using fprintf, I would think…
Thanks for your help!Hi, I have
Z1= sqrt(3) * exp((pi*i)/4)
Z2= 2 * exp((pi*i)/6)
Z3= sqrt(3) * exp((3*pi*i)/4)
Z4= 2 * exp(pi*i)
Z5= 2 * exp(-pi*i)
And I would like something like
Real Complex
Z1 1.2247 + 1.2247i
Z2 1.7321 + 1.0000i
Z3 -1.2247 + 1.2247i
Z4 -2.0000 + 0.0000i
Z5 -2.0000 – 0.0000i
Using fprintf, I would think…
Thanks for your help! Hi, I have
Z1= sqrt(3) * exp((pi*i)/4)
Z2= 2 * exp((pi*i)/6)
Z3= sqrt(3) * exp((3*pi*i)/4)
Z4= 2 * exp(pi*i)
Z5= 2 * exp(-pi*i)
And I would like something like
Real Complex
Z1 1.2247 + 1.2247i
Z2 1.7321 + 1.0000i
Z3 -1.2247 + 1.2247i
Z4 -2.0000 + 0.0000i
Z5 -2.0000 – 0.0000i
Using fprintf, I would think…
Thanks for your help! fprintf print complex MATLAB Answers — New Questions
exportgraphics does not save exactly what I see in the plot
Hi,
I am new to Matlab. Let me first explain what I want to do, and then my problem. First, I want to plot a line with two shaded intervals around it (basically, the impulse response with two confidence intervals). After reading some posts in this forum, I managed to do it (thanks a lot, Matlab community). Probably that is not the best way (I plot one shaded region over another), but it seems to work. Below I provide an example.
% Create values to plot
IR = [1 2 5; 5 3 8; 2 2 5]’;
INF = IR-0.50;
SUP = IR+0.50;
INF2 = IR-1;
SUP2 = IR+1;
% Define the rows and columns for the subplots (you choose)
row = 2;
col = 2;
% Define a timeline
nsteps = size(IR, 1);
steps = 1:1:nsteps;
x_axis = zeros(1,nsteps);
x = steps;
% Options for plot
opt_plot.marker = ‘o’;
opt_plot.linecol = [13, 54, 84]./255;
opt_plot.swathecol = [138, 178, 212]./255;
opt_plot.linewidth = 2;
opt_plot.alpha = 0.5;
opt_plot.marker_x = ‘–k’;
opt_plot.linewidth_x = 0.5;
FigSize(26, 24)
% var1
ii = 1;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,1);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var1′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var2
ii = 2;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,2);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var2′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var3
ii = 3;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,3);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var3′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
After runing it, I get the following plot in Matlab.
But when I use exportgraphics to export the plot in PDF format (by using the code below), it does not save exactly what I see in the plot.
% Save
exportgraphics(gcf,’example.pdf’, ‘ContentType’, ‘vector’);
clf(‘reset’)
To be more precise, the plot contains the two shaded intervals (as you can see in the image above), but exportgraphics saves a PDF file with only one shaded interval (image below).
Can anyone help me, please? Thanks in advance.Hi,
I am new to Matlab. Let me first explain what I want to do, and then my problem. First, I want to plot a line with two shaded intervals around it (basically, the impulse response with two confidence intervals). After reading some posts in this forum, I managed to do it (thanks a lot, Matlab community). Probably that is not the best way (I plot one shaded region over another), but it seems to work. Below I provide an example.
% Create values to plot
IR = [1 2 5; 5 3 8; 2 2 5]’;
INF = IR-0.50;
SUP = IR+0.50;
INF2 = IR-1;
SUP2 = IR+1;
% Define the rows and columns for the subplots (you choose)
row = 2;
col = 2;
% Define a timeline
nsteps = size(IR, 1);
steps = 1:1:nsteps;
x_axis = zeros(1,nsteps);
x = steps;
% Options for plot
opt_plot.marker = ‘o’;
opt_plot.linecol = [13, 54, 84]./255;
opt_plot.swathecol = [138, 178, 212]./255;
opt_plot.linewidth = 2;
opt_plot.alpha = 0.5;
opt_plot.marker_x = ‘–k’;
opt_plot.linewidth_x = 0.5;
FigSize(26, 24)
% var1
ii = 1;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,1);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var1′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var2
ii = 2;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,2);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var2′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var3
ii = 3;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,3);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var3′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
After runing it, I get the following plot in Matlab.
But when I use exportgraphics to export the plot in PDF format (by using the code below), it does not save exactly what I see in the plot.
% Save
exportgraphics(gcf,’example.pdf’, ‘ContentType’, ‘vector’);
clf(‘reset’)
To be more precise, the plot contains the two shaded intervals (as you can see in the image above), but exportgraphics saves a PDF file with only one shaded interval (image below).
Can anyone help me, please? Thanks in advance. Hi,
I am new to Matlab. Let me first explain what I want to do, and then my problem. First, I want to plot a line with two shaded intervals around it (basically, the impulse response with two confidence intervals). After reading some posts in this forum, I managed to do it (thanks a lot, Matlab community). Probably that is not the best way (I plot one shaded region over another), but it seems to work. Below I provide an example.
% Create values to plot
IR = [1 2 5; 5 3 8; 2 2 5]’;
INF = IR-0.50;
SUP = IR+0.50;
INF2 = IR-1;
SUP2 = IR+1;
% Define the rows and columns for the subplots (you choose)
row = 2;
col = 2;
% Define a timeline
nsteps = size(IR, 1);
steps = 1:1:nsteps;
x_axis = zeros(1,nsteps);
x = steps;
% Options for plot
opt_plot.marker = ‘o’;
opt_plot.linecol = [13, 54, 84]./255;
opt_plot.swathecol = [138, 178, 212]./255;
opt_plot.linewidth = 2;
opt_plot.alpha = 0.5;
opt_plot.marker_x = ‘–k’;
opt_plot.linewidth_x = 0.5;
FigSize(26, 24)
% var1
ii = 1;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,1);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var1′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var2
ii = 2;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,2);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var2′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
% var3
ii = 3;
y = IR(:,ii)’;
ci1_u = SUP(:,ii)’;
ci1_l = INF(:,ii)’;
ci2_u = SUP2(:,ii)’;
ci2_l = INF2(:,ii)’;
subplot(row,col,3);
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on
patch([x fliplr(x)], [ci1_l fliplr(ci1_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
patch([x fliplr(x)], [ci2_l fliplr(ci2_u)], opt_plot.swathecol, ‘FaceAlpha’, opt_plot.alpha, ‘EdgeColor’, ‘none’)
plot(x, y, ‘color’, opt_plot.linecol, ‘Marker’, opt_plot.marker, ‘MarkerFaceColor’, opt_plot.linecol, ‘LineWidth’, opt_plot.linewidth); hold on % the same code line as above
plot(x_axis, opt_plot.marker_x, ‘LineWidth’, opt_plot.linewidth_x); hold on
xlim([1 nsteps]);
title(‘var3′,’FontSize’,11);
set(gca, ‘Layer’, ‘top’);
After runing it, I get the following plot in Matlab.
But when I use exportgraphics to export the plot in PDF format (by using the code below), it does not save exactly what I see in the plot.
% Save
exportgraphics(gcf,’example.pdf’, ‘ContentType’, ‘vector’);
clf(‘reset’)
To be more precise, the plot contains the two shaded intervals (as you can see in the image above), but exportgraphics saves a PDF file with only one shaded interval (image below).
Can anyone help me, please? Thanks in advance. exportgraphics, shaded interval MATLAB Answers — New Questions
Will I be auto-billed for my License renewal or at the end of a Trial License period?
Will I be auto-billed for my License renewal or at the end of a Trial License period? Will I be auto-billed for my License renewal or at the end of a Trial License period? Will I be auto-billed for my License renewal or at the end of a Trial License period? MATLAB Answers — New Questions









