Author: PuTI
Can I create an alias for timetable signals viewed with Signal Analyzer in Signal Processing Toolbox R2025b?
I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"?I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"? I am currently using Signal Analyzer in Signal Processing Toolbox R2025b to view signals from a timetable. Signals from timetable columns display as "<TimetableName>.<ColumnName>". Can I assign an alias to each signal so that the Signal Analyzer Legend displays "<alias>" instead of "<TimetableName>.<ColumnName>"? signalanalyzer, shortname, timetable, timeseries MATLAB Answers — New Questions
Error while debugging the customized simscape component
Hello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
AziziHello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
Azizi Hello,
I’m using Simscape language to make a customized component. Here is the code:
%—————————————————-
component Plant
%% Physical model
nodes
T = foundation.mechanical.translational.translational; %T:right
R = foundation.mechanical.rotational.rotational; % R:right
end
parameters
m = { 2.0, ‘kg’ }; % Mass of the robot
J = {0.15625, ‘kg*m^2’ }; %Moment of inertia
rw = {0.1, ‘m’}; % Wheel radius
Wd = {0.4, ‘m’}; % Chassis width between wheels
init_s = {0, ‘m’}; % Intial distance,s
init_theta = {0, ‘rad’}; % Initial orientation,theta
end
variables
v = { 0, ‘m/s’ }; %%translational velocity
w = { 0, ‘rad/s’ }; %rotational velocity
fl = {0,’kg*m/s^2′}; % force left
fr = {0,’kg*m/s^2′}; % force right or kg*m/s^2
theta = {0,’rad’}; % orientation
s = {0, ‘m’}; % distance of the path between 2 points
end
function setup
across( v, T.v, []);
across( w, R.w, [] );
through(fr, T.f, [] );
through(fl, T.f, [] );
theta = init_theta;
s = init_s;
end
equations
v == s.der;
w == theta.der;
v.der == (fr + fl)/m;
w.der == (fr – fl)*rw/J;
end
end
%—————————————————
It seems OK when I build the component without any error but when I compose the component in Simulink environment, the error appears to be like:
————————————————————-
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix.
Initial conditions solve failed to converge.
Dependency found among topology equations. Check for missing reference node.
————————————————————-
Any advice?
Regards,
Azizi simscape language, simulation error, simscape MATLAB Answers — New Questions
How to use a thermocouple block available in simscape block?
How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model.How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model. How to use the thermocouple block available in simscape library along with signal condition circuitry, for temperature measurement model. thermocouple, simscape MATLAB Answers — New Questions
how are additional samples added to the audiostreamer playrec output queue?
If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug)If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug) If I use the audiostreamer ‘play’ function, I can add additional samples to the output queue by calling ‘play’ when NumberPlayerSamples gets low. But this doesn’t work the same way for the ‘playrec’ function. If I call ‘playrec’ while there are samples in the output queue, it will not add to the output queue, but instead it replaces the output queue with the new samples. Thus, whatever was in the output queue previously was lost.
Is there some reason that it has to be that way? I attached some test code that sends multiple ASIO buffers of pink noise to the output queue and then it starts copying samples from the input to the output. I would expect that the latency from the input to the output would increase if I added more samples up front. Instead I see that it only outputs one buffer of pink noise and then starts copying the samples.
So, bug or intentional? (I vote bug) audiostreamer, playrec MATLAB Answers — New Questions
Using the Ideal Heat Flow Source block
Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me).Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me). Hi, I am working on a project with a friend in Simscape. I am new to this and that’s why wanted to know the significance of the Ideal Heat Flow Source (Thermal Sources). How exactly is it used? (The help file wasn’t clear enough for me). simscape MATLAB Answers — New Questions
Peak Finder / Bandpass Filter errors on SimElectrical
I am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J CI am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J C I am having an issue with two blocks on SimElectrical:
1) From a simple sine wave input, how do I increase samples per channel to above 3 such that I can use the Peak Finder block?
2) My bandpass filter (attached to my sine wave output) is giving me an error as follows:
Output port 1 of ‘Circuit/Bandpass Filter’ is a one dimensional vector with 1 elements.’
Any help would be appreciated,
J C simulink, filter, filter design, sine wave MATLAB Answers — New Questions
Matlab function ‘movmean’ doesn’t work on simulink
I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well)I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well) I’m designing movmean function on simulink using Matlab function block
And when i try to test the block by inputing timeseries data, the input and output of ‘movmean’ function is same.
I attach pics below
1) Moving Average function block
2) code of Moving Average block
3) input and output of Moving Average block (output is not computed well) matlab, simulink, movmean MATLAB Answers — New Questions
Why am i getting error “you don’t have permissions to folder /usr/MATLAB/R2024b” while installing R2025a?
Yes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the helpYes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the help Yes i know the question has been ask before, but since i’m not allowed to comment, im asking it again.
Yes i am Admin/root
and Yes permissions are 777 for /usr/MATLAB
No the link did not provide an Answer
Thanks for the help r2025a, updating MATLAB Answers — New Questions
Best practices for setting penalty values in objective functions for bayesopt in MATLAB
Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks!Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks! Hi all,
I’m using bayesop, and trying to design a “safe” objective function: whenever my function encounters out-of-domain inputs,or some kind of errors, I return a large penalty value instead of letting the algorithm fail, although I understand that this algorithm never fails but keeps on running even if it encounters an error.
My typical objective values are in the range of -2 to 2. I’m wondering, does the magnitude of the penalty value influence how bayesopt performs?
For example, would assigning a penalty of 20 have a noticeably different impact compared to a penalty of 1e6? Is there an optimal approach or rule of thumb for choosing penalty values so that invalid points are discouraged, yet the optimization routine remains numerically stable and efficient?
I’d appreciate any insights. Thanks! optimization, matlab MATLAB Answers — New Questions
How do I Create an array of plots. The results disapear into “handle to deleted PolarCompassPlot” See code
clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot"clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot" clearvars -except Radius_list Six_plots
Circle_num = 4
nlist = 1;
%Six_plots = F_six_plots(Circle_num, Radius_list);
Six_plots;
sz = size(Six_plots,2);
Plot_num(1:sz) = compassplot(ones)
jplot = 1;
while jplot < sz
Plot_num(nlist) = compassplot(Six_plots(1:nlist));
nlist = nlist+1;
jplot = jplot+1
end
X = Plot_num
Stepping thru the while works. Plot_num(nlist) is fine
X is all "handle to deleted PolarCompassPlot" plot_num MATLAB Answers — New Questions
Can I purchase additional packages/toolboxes after purchasing the student version of MATLAB?
In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase?In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase? In addition to the main Matlab software with the core package, there are numerous additional tools available. Can I purchase additional tools after buying Matlab, or is it not possible to expand the software after purchase? matlab, toolbox, students home MATLAB Answers — New Questions
DG Optimization through IEEE 14 bus bar system
Hello,
I need a code for optimal location and sizing of DG in IEEE 14 bus bar system using fuzzy logic algorithm Or ANFIS technique. My objective function is power loss reduction and voltage profile improvement with and without DG. If this code is available in MATLAB with anyone. Please share it with me on my email: naveedkhanuet@gmail.com
Thank you.Hello,
I need a code for optimal location and sizing of DG in IEEE 14 bus bar system using fuzzy logic algorithm Or ANFIS technique. My objective function is power loss reduction and voltage profile improvement with and without DG. If this code is available in MATLAB with anyone. Please share it with me on my email: naveedkhanuet@gmail.com
Thank you. Hello,
I need a code for optimal location and sizing of DG in IEEE 14 bus bar system using fuzzy logic algorithm Or ANFIS technique. My objective function is power loss reduction and voltage profile improvement with and without DG. If this code is available in MATLAB with anyone. Please share it with me on my email: naveedkhanuet@gmail.com
Thank you. dg, optimization MATLAB Answers — New Questions
How can I make use of the full window size when zooming into very tall images?
When zooming into an image with a hight aspect ratio (heigth much larger than its width), the displayed image is constrained to the area that was used with the original imshow command and the rest of the window remains unused. How can I make use of the full window size?
Example (normally imtall would be a linescan camera image of size 10000 by 512 pixels but this demonstrates my problem pretty well):
im=imread(‘cameraman.tif’);
imtall=repmat(im,11,1); % size 2816 by 256
imshow(imtall)
zoom(10)
There would be enough space to the left and right side in the window to display the full cameraman:When zooming into an image with a hight aspect ratio (heigth much larger than its width), the displayed image is constrained to the area that was used with the original imshow command and the rest of the window remains unused. How can I make use of the full window size?
Example (normally imtall would be a linescan camera image of size 10000 by 512 pixels but this demonstrates my problem pretty well):
im=imread(‘cameraman.tif’);
imtall=repmat(im,11,1); % size 2816 by 256
imshow(imtall)
zoom(10)
There would be enough space to the left and right side in the window to display the full cameraman: When zooming into an image with a hight aspect ratio (heigth much larger than its width), the displayed image is constrained to the area that was used with the original imshow command and the rest of the window remains unused. How can I make use of the full window size?
Example (normally imtall would be a linescan camera image of size 10000 by 512 pixels but this demonstrates my problem pretty well):
im=imread(‘cameraman.tif’);
imtall=repmat(im,11,1); % size 2816 by 256
imshow(imtall)
zoom(10)
There would be enough space to the left and right side in the window to display the full cameraman: imshow, zoom, aspect ratio MATLAB Answers — New Questions
Use variable values froma code block directly in a Live Script text cell (inline evaluation)
MATLAB help states that using backticks around a variable name will have it replaced with its value when its inline in a text block.I am using the Live Editor and saving as an mlx file. Below is an image of a section of code and I want to state the altitude in a text block. An extensive search of the internet provided these methods but none of them work. The variable name is not replaced by the value. Has anyone else tried this and had it work successfully? I prefer this to a statement in the code to write a sentence, its just cleaner overall. Any suggestions. tips or known examples that work? Trying out 2025b, does not work on 2023b either. Any help greatly appreciated!
Code image:MATLAB help states that using backticks around a variable name will have it replaced with its value when its inline in a text block.I am using the Live Editor and saving as an mlx file. Below is an image of a section of code and I want to state the altitude in a text block. An extensive search of the internet provided these methods but none of them work. The variable name is not replaced by the value. Has anyone else tried this and had it work successfully? I prefer this to a statement in the code to write a sentence, its just cleaner overall. Any suggestions. tips or known examples that work? Trying out 2025b, does not work on 2023b either. Any help greatly appreciated!
Code image: MATLAB help states that using backticks around a variable name will have it replaced with its value when its inline in a text block.I am using the Live Editor and saving as an mlx file. Below is an image of a section of code and I want to state the altitude in a text block. An extensive search of the internet provided these methods but none of them work. The variable name is not replaced by the value. Has anyone else tried this and had it work successfully? I prefer this to a statement in the code to write a sentence, its just cleaner overall. Any suggestions. tips or known examples that work? Trying out 2025b, does not work on 2023b either. Any help greatly appreciated!
Code image: live editor, inline text, matlab editor, matlab MATLAB Answers — New Questions
How to incorporate camera calibration in PIVlab
When using PIVlab it seems that the calibration options are rather limited, e.g. as far as I can see one cannot use camera extrinsics to compensate for camera orientation (one can only link pixel size to real world distance). Or should that somehow be taken into account when preprocessing the inout images ? The compensation for camera distortion (intrinsic) has to be done prior to importing the images into PIVlab, it would be great if an integration with the camera calibration app would be added to PIVlab, I’m sure this will save peoples time while a lot of mistakes can be avoided.When using PIVlab it seems that the calibration options are rather limited, e.g. as far as I can see one cannot use camera extrinsics to compensate for camera orientation (one can only link pixel size to real world distance). Or should that somehow be taken into account when preprocessing the inout images ? The compensation for camera distortion (intrinsic) has to be done prior to importing the images into PIVlab, it would be great if an integration with the camera calibration app would be added to PIVlab, I’m sure this will save peoples time while a lot of mistakes can be avoided. When using PIVlab it seems that the calibration options are rather limited, e.g. as far as I can see one cannot use camera extrinsics to compensate for camera orientation (one can only link pixel size to real world distance). Or should that somehow be taken into account when preprocessing the inout images ? The compensation for camera distortion (intrinsic) has to be done prior to importing the images into PIVlab, it would be great if an integration with the camera calibration app would be added to PIVlab, I’m sure this will save peoples time while a lot of mistakes can be avoided. pivlab, calibration camera extrinsics MATLAB Answers — New Questions
Add a datestr to duration data to get in datestr format
Hi, I have a graph where Im plotting on the x-axis time by using tic then in a loop making measurements ‘Y’ and performing tend=toc
I dor ecord the actual date / time at the start too.
dt = datestr(now,’dd-mmm-yyyy HH-MM-SS’); %get current dateTime
Once my loop has finished an I have a plot of all the Y’s against their time of measurements (starting at 0), how can I add the "duration" onto the actual datestr, so I can have on the x-axis the actual date time.
thanks
JasonHi, I have a graph where Im plotting on the x-axis time by using tic then in a loop making measurements ‘Y’ and performing tend=toc
I dor ecord the actual date / time at the start too.
dt = datestr(now,’dd-mmm-yyyy HH-MM-SS’); %get current dateTime
Once my loop has finished an I have a plot of all the Y’s against their time of measurements (starting at 0), how can I add the "duration" onto the actual datestr, so I can have on the x-axis the actual date time.
thanks
Jason Hi, I have a graph where Im plotting on the x-axis time by using tic then in a loop making measurements ‘Y’ and performing tend=toc
I dor ecord the actual date / time at the start too.
dt = datestr(now,’dd-mmm-yyyy HH-MM-SS’); %get current dateTime
Once my loop has finished an I have a plot of all the Y’s against their time of measurements (starting at 0), how can I add the "duration" onto the actual datestr, so I can have on the x-axis the actual date time.
thanks
Jason datestr, tic, toc MATLAB Answers — New Questions
How to draw line in viewer3d ?
Hello,
I m trying to use viewer3d as a openGL viewer and it works well for 3D surface and 3D points using images.ui.graphics.Surface and images.ui.graphics.Points but i wonder if it is possible to draw line or connected line inside the viewer ? I dont mean how to show wireframe when using a surface or annotation line.
I just try for exemple to attached 3 vectors in X,Y and Z direction to each 3D object.
I saw 2 functions WideLine and Thinline but i did not find any documentation about them.
Thanks for your helpHello,
I m trying to use viewer3d as a openGL viewer and it works well for 3D surface and 3D points using images.ui.graphics.Surface and images.ui.graphics.Points but i wonder if it is possible to draw line or connected line inside the viewer ? I dont mean how to show wireframe when using a surface or annotation line.
I just try for exemple to attached 3 vectors in X,Y and Z direction to each 3D object.
I saw 2 functions WideLine and Thinline but i did not find any documentation about them.
Thanks for your help Hello,
I m trying to use viewer3d as a openGL viewer and it works well for 3D surface and 3D points using images.ui.graphics.Surface and images.ui.graphics.Points but i wonder if it is possible to draw line or connected line inside the viewer ? I dont mean how to show wireframe when using a surface or annotation line.
I just try for exemple to attached 3 vectors in X,Y and Z direction to each 3D object.
I saw 2 functions WideLine and Thinline but i did not find any documentation about them.
Thanks for your help viewer3d, thinline, wideline, images.ui.graphics.viewer MATLAB Answers — New Questions
.mldatx file lost all data in the “Archive” section after saving failed due to insufficient disk space, while file size remains unchanged
I am experiencing an issue with a MATLAB .mldatx file and the Data Inspector.
Initially, I saved the .mldatx file for the first time before plotting any data in the Data Inspector.
After that, I plotted the data and attempted to save the file a second time.
During this second save process, the save operation did not complete successfully because the disk was full, which caused MATLAB to throw an error. After freeing up disk space, I reopened the same .mldatx file.
However, when opening the file again, all run data under the “Archive” section is missing, including all plotted graphs. At the same time, the file size shown in the file system is unchanged from before the issue occurred.
I would like to understand:
Why the Archive data and plots disappeared even though the file size is still the same
Whether the data is corrupted or still recoverable
If there is any way to restore the lost Archive data or prevent this issue in the futureI am experiencing an issue with a MATLAB .mldatx file and the Data Inspector.
Initially, I saved the .mldatx file for the first time before plotting any data in the Data Inspector.
After that, I plotted the data and attempted to save the file a second time.
During this second save process, the save operation did not complete successfully because the disk was full, which caused MATLAB to throw an error. After freeing up disk space, I reopened the same .mldatx file.
However, when opening the file again, all run data under the “Archive” section is missing, including all plotted graphs. At the same time, the file size shown in the file system is unchanged from before the issue occurred.
I would like to understand:
Why the Archive data and plots disappeared even though the file size is still the same
Whether the data is corrupted or still recoverable
If there is any way to restore the lost Archive data or prevent this issue in the future I am experiencing an issue with a MATLAB .mldatx file and the Data Inspector.
Initially, I saved the .mldatx file for the first time before plotting any data in the Data Inspector.
After that, I plotted the data and attempted to save the file a second time.
During this second save process, the save operation did not complete successfully because the disk was full, which caused MATLAB to throw an error. After freeing up disk space, I reopened the same .mldatx file.
However, when opening the file again, all run data under the “Archive” section is missing, including all plotted graphs. At the same time, the file size shown in the file system is unchanged from before the issue occurred.
I would like to understand:
Why the Archive data and plots disappeared even though the file size is still the same
Whether the data is corrupted or still recoverable
If there is any way to restore the lost Archive data or prevent this issue in the future matlab, data inspector, .mldatx, mldatx, file corruption 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
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









