Author: PuTI
Create figures with different number of images but same sizes
I try to create 2 figures in 2 different scripts.
Script 1 looks like this:
img_sos = rand(64);
img_oar_pixel = rand(64);
img_oar_block = rand(64);
img_sos = img_sos / max(img_sos(:));
img_oar_pixel = img_oar_pixel / max(img_oar_pixel(:));
img_oar_block = img_oar_block / max(img_oar_block(:));
f = figure;
tl = tiledlayout(1, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
clim1 = [0 1];
cmap1 = jet;
ax1 = [];
ax1(1) = nexttile;
imagesc(img_sos, clim1);
axis image off;
title(‘Sum-of-Squares’, ‘FontSize’, 10);
ax1(2) = nexttile;
imagesc(img_oar_pixel, clim1);
axis image off;
title(‘Adaptive Kombination (Pixelweise)’, ‘FontSize’, 10);
ax1(3) = nexttile;
imagesc(img_oar_block, clim1);
axis image off;
title(‘Adaptive Kombination (Blockweise)’, ‘FontSize’, 10);
set(ax1, ‘Colormap’, cmap1);
cb1 = colorbar(ax1(end), ‘eastoutside’);
cb1.Label.String = ‘Normierte Signalintensität’;
cb1.Label.FontSize = 10;
cb1.Ticks = 0:0.2:1;
My second script looks like this:
figure; %<—Matt J added
img_oar_rec = rand(64);
img_oar_rec = img_oar_rec/max(img_oar_rec(:));
img_mask = rand(64);
tiledlayout(1, 2, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
ax1 = nexttile;
imagesc(img_oar_rec, [0 1]);
axis image off;
colormap(ax1, ‘jet’);
cb = colorbar;
cb.Label.String = ‘Normierte Signalintensität’;
cb.Label.FontSize = 10;
title(‘Adaptive Kombination’, ‘FontSize’, 10);
ax2 = nexttile;
imagesc(img_mask);
axis image off;
colormap(ax2, ‘gray’);
title(‘Binäre Maske’, ‘FontSize’, 10);
As I want to use these figures in a latex report, I want to save these figures as jpg.
But in both figures, the images should have the same size. Same for the titles and colorbar strings.
How can I do that? I should not scale figures in latex.I try to create 2 figures in 2 different scripts.
Script 1 looks like this:
img_sos = rand(64);
img_oar_pixel = rand(64);
img_oar_block = rand(64);
img_sos = img_sos / max(img_sos(:));
img_oar_pixel = img_oar_pixel / max(img_oar_pixel(:));
img_oar_block = img_oar_block / max(img_oar_block(:));
f = figure;
tl = tiledlayout(1, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
clim1 = [0 1];
cmap1 = jet;
ax1 = [];
ax1(1) = nexttile;
imagesc(img_sos, clim1);
axis image off;
title(‘Sum-of-Squares’, ‘FontSize’, 10);
ax1(2) = nexttile;
imagesc(img_oar_pixel, clim1);
axis image off;
title(‘Adaptive Kombination (Pixelweise)’, ‘FontSize’, 10);
ax1(3) = nexttile;
imagesc(img_oar_block, clim1);
axis image off;
title(‘Adaptive Kombination (Blockweise)’, ‘FontSize’, 10);
set(ax1, ‘Colormap’, cmap1);
cb1 = colorbar(ax1(end), ‘eastoutside’);
cb1.Label.String = ‘Normierte Signalintensität’;
cb1.Label.FontSize = 10;
cb1.Ticks = 0:0.2:1;
My second script looks like this:
figure; %<—Matt J added
img_oar_rec = rand(64);
img_oar_rec = img_oar_rec/max(img_oar_rec(:));
img_mask = rand(64);
tiledlayout(1, 2, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
ax1 = nexttile;
imagesc(img_oar_rec, [0 1]);
axis image off;
colormap(ax1, ‘jet’);
cb = colorbar;
cb.Label.String = ‘Normierte Signalintensität’;
cb.Label.FontSize = 10;
title(‘Adaptive Kombination’, ‘FontSize’, 10);
ax2 = nexttile;
imagesc(img_mask);
axis image off;
colormap(ax2, ‘gray’);
title(‘Binäre Maske’, ‘FontSize’, 10);
As I want to use these figures in a latex report, I want to save these figures as jpg.
But in both figures, the images should have the same size. Same for the titles and colorbar strings.
How can I do that? I should not scale figures in latex. I try to create 2 figures in 2 different scripts.
Script 1 looks like this:
img_sos = rand(64);
img_oar_pixel = rand(64);
img_oar_block = rand(64);
img_sos = img_sos / max(img_sos(:));
img_oar_pixel = img_oar_pixel / max(img_oar_pixel(:));
img_oar_block = img_oar_block / max(img_oar_block(:));
f = figure;
tl = tiledlayout(1, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
clim1 = [0 1];
cmap1 = jet;
ax1 = [];
ax1(1) = nexttile;
imagesc(img_sos, clim1);
axis image off;
title(‘Sum-of-Squares’, ‘FontSize’, 10);
ax1(2) = nexttile;
imagesc(img_oar_pixel, clim1);
axis image off;
title(‘Adaptive Kombination (Pixelweise)’, ‘FontSize’, 10);
ax1(3) = nexttile;
imagesc(img_oar_block, clim1);
axis image off;
title(‘Adaptive Kombination (Blockweise)’, ‘FontSize’, 10);
set(ax1, ‘Colormap’, cmap1);
cb1 = colorbar(ax1(end), ‘eastoutside’);
cb1.Label.String = ‘Normierte Signalintensität’;
cb1.Label.FontSize = 10;
cb1.Ticks = 0:0.2:1;
My second script looks like this:
figure; %<—Matt J added
img_oar_rec = rand(64);
img_oar_rec = img_oar_rec/max(img_oar_rec(:));
img_mask = rand(64);
tiledlayout(1, 2, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
ax1 = nexttile;
imagesc(img_oar_rec, [0 1]);
axis image off;
colormap(ax1, ‘jet’);
cb = colorbar;
cb.Label.String = ‘Normierte Signalintensität’;
cb.Label.FontSize = 10;
title(‘Adaptive Kombination’, ‘FontSize’, 10);
ax2 = nexttile;
imagesc(img_mask);
axis image off;
colormap(ax2, ‘gray’);
title(‘Binäre Maske’, ‘FontSize’, 10);
As I want to use these figures in a latex report, I want to save these figures as jpg.
But in both figures, the images should have the same size. Same for the titles and colorbar strings.
How can I do that? I should not scale figures in latex. figure, subplot, image, export MATLAB Answers — New Questions
I want to convert matlab code to verilog for my image processing project using hdl coder, i have the code but i dont know how to divide my code into function and test bench, please help me. I m using matlab r2018a version.
if true
% code
endif true
% code
end if true
% code
end image processing MATLAB Answers — New Questions
Request for Guidance and Resources for Electric Powertrain Control Project – Formula Student
I am currently developing a Simulink-based model for controlling the current delivered to a dual-motor inverter system in an electric powertrain, as part of a Formula Student vehicle project.
The controller will run on an embedded unit and will be responsible for computing the reference currents based on various inputs, such as vehicle speed, throttle position, and steering angle. The model will eventually be converted to C code using MATLAB tools for deployment on the ECU.
I already have experience using MATLAB and Simulink and would like to ask if you have any guidance, documentation, or reference Simulink models relevant to electric powertrain current control, inverter control, or electric motor control systems. I would also appreciate your advice on which MATLAB/Simulink toolboxes or add-ons are best suited for this type of application.
Thank you in advance for your time and support.I am currently developing a Simulink-based model for controlling the current delivered to a dual-motor inverter system in an electric powertrain, as part of a Formula Student vehicle project.
The controller will run on an embedded unit and will be responsible for computing the reference currents based on various inputs, such as vehicle speed, throttle position, and steering angle. The model will eventually be converted to C code using MATLAB tools for deployment on the ECU.
I already have experience using MATLAB and Simulink and would like to ask if you have any guidance, documentation, or reference Simulink models relevant to electric powertrain current control, inverter control, or electric motor control systems. I would also appreciate your advice on which MATLAB/Simulink toolboxes or add-ons are best suited for this type of application.
Thank you in advance for your time and support. I am currently developing a Simulink-based model for controlling the current delivered to a dual-motor inverter system in an electric powertrain, as part of a Formula Student vehicle project.
The controller will run on an embedded unit and will be responsible for computing the reference currents based on various inputs, such as vehicle speed, throttle position, and steering angle. The model will eventually be converted to C code using MATLAB tools for deployment on the ECU.
I already have experience using MATLAB and Simulink and would like to ask if you have any guidance, documentation, or reference Simulink models relevant to electric powertrain current control, inverter control, or electric motor control systems. I would also appreciate your advice on which MATLAB/Simulink toolboxes or add-ons are best suited for this type of application.
Thank you in advance for your time and support. racinglounge, inverter_controller MATLAB Answers — New Questions
Merging multiple dictionaries with dictionaries
Related to this question, how can one merge two dictionaries that have dictionaries as the keys and values?
A = dictionary(dictionary(["key1"], {1}), dictionary(["key2"], {2}));
A(dictionary(["key3"], {3})) = dictionary(["key4"], {4})
B = dictionary(dictionary(["key5"], {5}), dictionary(["key6"], {6}));
B(dictionary(["key7"], {7})) = dictionary(["key8"], {8})
C = dictionary(A.keys, A.values)
C(B.keys) = B.valuesRelated to this question, how can one merge two dictionaries that have dictionaries as the keys and values?
A = dictionary(dictionary(["key1"], {1}), dictionary(["key2"], {2}));
A(dictionary(["key3"], {3})) = dictionary(["key4"], {4})
B = dictionary(dictionary(["key5"], {5}), dictionary(["key6"], {6}));
B(dictionary(["key7"], {7})) = dictionary(["key8"], {8})
C = dictionary(A.keys, A.values)
C(B.keys) = B.values Related to this question, how can one merge two dictionaries that have dictionaries as the keys and values?
A = dictionary(dictionary(["key1"], {1}), dictionary(["key2"], {2}));
A(dictionary(["key3"], {3})) = dictionary(["key4"], {4})
B = dictionary(dictionary(["key5"], {5}), dictionary(["key6"], {6}));
B(dictionary(["key7"], {7})) = dictionary(["key8"], {8})
C = dictionary(A.keys, A.values)
C(B.keys) = B.values dictionary MATLAB Answers — New Questions
Cap Maximum ODE solve time
I am solving a set of ODEs with several different initial conditions some of which will be badly conditioned and get bogged down. I want to cap the run time of an individual solve to say 100 seconds. If it reaches 100 seconds, I want to exit and just mark the solve as fail. I haven’t been able to find a way to do this on the forum. Does anyone have any suggestions?I am solving a set of ODEs with several different initial conditions some of which will be badly conditioned and get bogged down. I want to cap the run time of an individual solve to say 100 seconds. If it reaches 100 seconds, I want to exit and just mark the solve as fail. I haven’t been able to find a way to do this on the forum. Does anyone have any suggestions? I am solving a set of ODEs with several different initial conditions some of which will be badly conditioned and get bogged down. I want to cap the run time of an individual solve to say 100 seconds. If it reaches 100 seconds, I want to exit and just mark the solve as fail. I haven’t been able to find a way to do this on the forum. Does anyone have any suggestions? ode MATLAB Answers — New Questions
How to Apply Multiple BC Types (Dirichlet, Robin, Neumann) on a Single 3D Face?
Hello MATLAB Community,
I am trying to solve a 3D transient heat transfer problem on a simple cuboid using the PDE Toolbox.
My main challenge is applying three different types of boundary conditions to different regions of a single face.
Problem Description:
The geometry is a simple 3D block. The boundary conditions are:
Back Face (x=0): Constant temperature (Dirichlet condition).
All 4 Side Faces (in Y and Z): Adiabatic (zero flux / Neumann).
Front Face (x=L): This face needs a composite boundary condition, as shown in this diagram:
A central rectangular region with a constant temperature (Dirichlet).
Regions above and below the central patch with convection (Robin).
Regions to the left and right of the central patch which are adiabatic (Neumann).
What is the correct programmatic method to define these different types of boundary conditions on sub-regions of a single face, especially in a version of MATLAB that does not seem to support the more recent, flexible function handle syntaxes?Hello MATLAB Community,
I am trying to solve a 3D transient heat transfer problem on a simple cuboid using the PDE Toolbox.
My main challenge is applying three different types of boundary conditions to different regions of a single face.
Problem Description:
The geometry is a simple 3D block. The boundary conditions are:
Back Face (x=0): Constant temperature (Dirichlet condition).
All 4 Side Faces (in Y and Z): Adiabatic (zero flux / Neumann).
Front Face (x=L): This face needs a composite boundary condition, as shown in this diagram:
A central rectangular region with a constant temperature (Dirichlet).
Regions above and below the central patch with convection (Robin).
Regions to the left and right of the central patch which are adiabatic (Neumann).
What is the correct programmatic method to define these different types of boundary conditions on sub-regions of a single face, especially in a version of MATLAB that does not seem to support the more recent, flexible function handle syntaxes? Hello MATLAB Community,
I am trying to solve a 3D transient heat transfer problem on a simple cuboid using the PDE Toolbox.
My main challenge is applying three different types of boundary conditions to different regions of a single face.
Problem Description:
The geometry is a simple 3D block. The boundary conditions are:
Back Face (x=0): Constant temperature (Dirichlet condition).
All 4 Side Faces (in Y and Z): Adiabatic (zero flux / Neumann).
Front Face (x=L): This face needs a composite boundary condition, as shown in this diagram:
A central rectangular region with a constant temperature (Dirichlet).
Regions above and below the central patch with convection (Robin).
Regions to the left and right of the central patch which are adiabatic (Neumann).
What is the correct programmatic method to define these different types of boundary conditions on sub-regions of a single face, especially in a version of MATLAB that does not seem to support the more recent, flexible function handle syntaxes? pde, pde-toolbox, boundary-conditions, 3d, fem MATLAB Answers — New Questions
How to find the MATLAB code in the MATLAB Simulink example file
how to check the code for timing calculations (SVPWM Generator (3 Level)) in the MATLAB simulink example file Power_SVPWM_3Levelhow to check the code for timing calculations (SVPWM Generator (3 Level)) in the MATLAB simulink example file Power_SVPWM_3Level how to check the code for timing calculations (SVPWM Generator (3 Level)) in the MATLAB simulink example file Power_SVPWM_3Level simulink example file MATLAB Answers — New Questions
How can I create user accounts for MATLAB Web App Server?
I am using MATLAB Web App Server to host apps for a group of end users outside my organization. I notice that MATLAB Web App Server supports user authentication, and I would like to use this to grant access to my end users and monitor their app usage. However, since these are external users, I do not want to set up authentication using my existing internal company identity provider.
Is there a good way to create and manage user accounts for external users for MATLAB Web App Server?I am using MATLAB Web App Server to host apps for a group of end users outside my organization. I notice that MATLAB Web App Server supports user authentication, and I would like to use this to grant access to my end users and monitor their app usage. However, since these are external users, I do not want to set up authentication using my existing internal company identity provider.
Is there a good way to create and manage user accounts for external users for MATLAB Web App Server? I am using MATLAB Web App Server to host apps for a group of end users outside my organization. I notice that MATLAB Web App Server supports user authentication, and I would like to use this to grant access to my end users and monitor their app usage. However, since these are external users, I do not want to set up authentication using my existing internal company identity provider.
Is there a good way to create and manage user accounts for external users for MATLAB Web App Server? MATLAB Answers — New Questions
Automatic line selection bug
When I click on a line in the Editor and scroll the mouse cursor up or down, MATLAB automatically selects and highlights across lines as in the screenhot enclosed. This started to happen only recently. I wonder if this has anything to do with the latest macOS update 15.1 or the latest MATLAB update 224b.When I click on a line in the Editor and scroll the mouse cursor up or down, MATLAB automatically selects and highlights across lines as in the screenhot enclosed. This started to happen only recently. I wonder if this has anything to do with the latest macOS update 15.1 or the latest MATLAB update 224b. When I click on a line in the Editor and scroll the mouse cursor up or down, MATLAB automatically selects and highlights across lines as in the screenhot enclosed. This started to happen only recently. I wonder if this has anything to do with the latest macOS update 15.1 or the latest MATLAB update 224b. bug MATLAB Answers — New Questions
ISSUE WITH SIMULATING BATTERY CELL AFTER PARAMETER ESTIMATION TASK?
Hello,
I have estimated the 2RC equivalent circuit model battery using parameter estimation task. all my updated parameters (SOC,V0,R0,R1, TAU1,R2,TAU2) are of size 21X1 (double). when i am using this parametrized cell with discharger block at 1C discharge(which is for 3600 seconds duration), the results are confusing to me. The cell get discharged completely at 1200 seconds,i.e. reaching to cut off voltage of 2.5V and not showing any effect after it. I am unable to understand what is wrong? Please help.
Thanks,
SudeepHello,
I have estimated the 2RC equivalent circuit model battery using parameter estimation task. all my updated parameters (SOC,V0,R0,R1, TAU1,R2,TAU2) are of size 21X1 (double). when i am using this parametrized cell with discharger block at 1C discharge(which is for 3600 seconds duration), the results are confusing to me. The cell get discharged completely at 1200 seconds,i.e. reaching to cut off voltage of 2.5V and not showing any effect after it. I am unable to understand what is wrong? Please help.
Thanks,
Sudeep Hello,
I have estimated the 2RC equivalent circuit model battery using parameter estimation task. all my updated parameters (SOC,V0,R0,R1, TAU1,R2,TAU2) are of size 21X1 (double). when i am using this parametrized cell with discharger block at 1C discharge(which is for 3600 seconds duration), the results are confusing to me. The cell get discharged completely at 1200 seconds,i.e. reaching to cut off voltage of 2.5V and not showing any effect after it. I am unable to understand what is wrong? Please help.
Thanks,
Sudeep parameter estimation, optimization, battery_system_management MATLAB Answers — New Questions
Volume Property in trackerGNN
What exactly is Volume property of trackerGNN? Won’t this volume change from one measurement bin to next depending upon distance from Sensor? If so, how to choose an appropriate value for this parameter?What exactly is Volume property of trackerGNN? Won’t this volume change from one measurement bin to next depending upon distance from Sensor? If so, how to choose an appropriate value for this parameter? What exactly is Volume property of trackerGNN? Won’t this volume change from one measurement bin to next depending upon distance from Sensor? If so, how to choose an appropriate value for this parameter? trackergnn MATLAB Answers — New Questions
MATLAB /Simulink Fundamental question
Hey guys – just wondering, what is the best way to model a given system ? I understand matlab code may look messy and hard to follow, especially for a big model but my gut feeling is that it would run faster than a simulink equivalent (I’ve tested this with a dummy model).
What do you guys think ? Is there a particular set of factors that are key in making a decision as to whether a system should be modelled in matlab or simulink ? Any thoughts appreciated !
Many thanks
BHey guys – just wondering, what is the best way to model a given system ? I understand matlab code may look messy and hard to follow, especially for a big model but my gut feeling is that it would run faster than a simulink equivalent (I’ve tested this with a dummy model).
What do you guys think ? Is there a particular set of factors that are key in making a decision as to whether a system should be modelled in matlab or simulink ? Any thoughts appreciated !
Many thanks
B Hey guys – just wondering, what is the best way to model a given system ? I understand matlab code may look messy and hard to follow, especially for a big model but my gut feeling is that it would run faster than a simulink equivalent (I’ve tested this with a dummy model).
What do you guys think ? Is there a particular set of factors that are key in making a decision as to whether a system should be modelled in matlab or simulink ? Any thoughts appreciated !
Many thanks
B simulink matlab modelling MATLAB Answers — New Questions
Wonky solutions for mixed parabolic-hyperbolic PDEs
I’m solving the equations:
I’m using the finite volume method with a constant spacing on dh, so it seems to be a simple solution. The boundary conditions are functions of nu, and I compute the boundary terms by using a simple polynomial. I conpute the density which is 1/nu, but I get funky boundary values that I don’ understand. can anyone explain what is wrong?I’m solving the equations:
I’m using the finite volume method with a constant spacing on dh, so it seems to be a simple solution. The boundary conditions are functions of nu, and I compute the boundary terms by using a simple polynomial. I conpute the density which is 1/nu, but I get funky boundary values that I don’ understand. can anyone explain what is wrong? I’m solving the equations:
I’m using the finite volume method with a constant spacing on dh, so it seems to be a simple solution. The boundary conditions are functions of nu, and I compute the boundary terms by using a simple polynomial. I conpute the density which is 1/nu, but I get funky boundary values that I don’ understand. can anyone explain what is wrong? ode15, pde MATLAB Answers — New Questions
”Simulink Linearization Issue”
"MATLAB 2025a features a more professional user interface and improved computational speed, but it also introduces new error messages. I encountered a linearization failure error in Simulink while working with a jet engine model composed of T-MATS (a NASA-developed turbofan engine modeling toolbox) components. The current error message is as follows: ‘Error: STD exception ‘class std::bad_function_call’: ‘bad function call’ caught.’ It appears to be an issue with the underlying MEX function. How can I resolve this?""MATLAB 2025a features a more professional user interface and improved computational speed, but it also introduces new error messages. I encountered a linearization failure error in Simulink while working with a jet engine model composed of T-MATS (a NASA-developed turbofan engine modeling toolbox) components. The current error message is as follows: ‘Error: STD exception ‘class std::bad_function_call’: ‘bad function call’ caught.’ It appears to be an issue with the underlying MEX function. How can I resolve this?" "MATLAB 2025a features a more professional user interface and improved computational speed, but it also introduces new error messages. I encountered a linearization failure error in Simulink while working with a jet engine model composed of T-MATS (a NASA-developed turbofan engine modeling toolbox) components. The current error message is as follows: ‘Error: STD exception ‘class std::bad_function_call’: ‘bad function call’ caught.’ It appears to be an issue with the underlying MEX function. How can I resolve this?" simulink, mex MATLAB Answers — New Questions
Transforming graphs horizontally and vertically to properly compare
I have several files of data which, when plotted, look like the image presented. My problem is that i need them all to be laid on top of each other, with the beginning of the rise of the first sinusoidal wave matched up in the x and y. This is so that I can create an average waveform to reduce noise in the readings. Currently, my code impoorts all my text files, 30 of them, into an array and plots them using the following loop
for K = 1 : 30 %open and read the text files
S{K} = readtable(files(K));
Sr{K} = rmmissing(S{K}); %remove NaN values from the text files
end
for K = 1 : 30 %plot each indivdual graph for comparisons
plot(Sr{K}.(1), Sr{K}.(2), ‘displayname’, files(K));
hold on
end
I know how to transform them all individually, but cannot figure out how to make it all happen at once. I attempted to use a matchFeatures command, but could not figure out precisely how to do what I wished.
The goal is for the first graph to look similar to the second, where the initial rise is matched, allowing the peaks to be easily compared.
Any help would be appreciated, thank you!I have several files of data which, when plotted, look like the image presented. My problem is that i need them all to be laid on top of each other, with the beginning of the rise of the first sinusoidal wave matched up in the x and y. This is so that I can create an average waveform to reduce noise in the readings. Currently, my code impoorts all my text files, 30 of them, into an array and plots them using the following loop
for K = 1 : 30 %open and read the text files
S{K} = readtable(files(K));
Sr{K} = rmmissing(S{K}); %remove NaN values from the text files
end
for K = 1 : 30 %plot each indivdual graph for comparisons
plot(Sr{K}.(1), Sr{K}.(2), ‘displayname’, files(K));
hold on
end
I know how to transform them all individually, but cannot figure out how to make it all happen at once. I attempted to use a matchFeatures command, but could not figure out precisely how to do what I wished.
The goal is for the first graph to look similar to the second, where the initial rise is matched, allowing the peaks to be easily compared.
Any help would be appreciated, thank you! I have several files of data which, when plotted, look like the image presented. My problem is that i need them all to be laid on top of each other, with the beginning of the rise of the first sinusoidal wave matched up in the x and y. This is so that I can create an average waveform to reduce noise in the readings. Currently, my code impoorts all my text files, 30 of them, into an array and plots them using the following loop
for K = 1 : 30 %open and read the text files
S{K} = readtable(files(K));
Sr{K} = rmmissing(S{K}); %remove NaN values from the text files
end
for K = 1 : 30 %plot each indivdual graph for comparisons
plot(Sr{K}.(1), Sr{K}.(2), ‘displayname’, files(K));
hold on
end
I know how to transform them all individually, but cannot figure out how to make it all happen at once. I attempted to use a matchFeatures command, but could not figure out precisely how to do what I wished.
The goal is for the first graph to look similar to the second, where the initial rise is matched, allowing the peaks to be easily compared.
Any help would be appreciated, thank you! graph, transformation MATLAB Answers — New Questions
After exiting MATLAB, it doesn’t truly terminate in the Task Manager.
After exiting MATLAB, it doesn’t truly terminate in the Task Manager.
Even after closing the MATLAB software (including using the exit command), the memory usage remains the same as when MATLAB was running, and the related processes don’t exit.
When MATLAB is reopened, new related tasks are created.
Consequently, after repeatedly opening and closing the software several times, the memory becomes completely full, causing the computer to malfunction.After exiting MATLAB, it doesn’t truly terminate in the Task Manager.
Even after closing the MATLAB software (including using the exit command), the memory usage remains the same as when MATLAB was running, and the related processes don’t exit.
When MATLAB is reopened, new related tasks are created.
Consequently, after repeatedly opening and closing the software several times, the memory becomes completely full, causing the computer to malfunction. After exiting MATLAB, it doesn’t truly terminate in the Task Manager.
Even after closing the MATLAB software (including using the exit command), the memory usage remains the same as when MATLAB was running, and the related processes don’t exit.
When MATLAB is reopened, new related tasks are created.
Consequently, after repeatedly opening and closing the software several times, the memory becomes completely full, causing the computer to malfunction. matlab memory leak, matlab process remaining MATLAB Answers — New Questions
Find the centers of multiple polygons
I have an nx3 matrix that holds the locations for the vertices of a chain of hexagonal shapes (images 1, 2).
Side-note: The coordinates for the vertices of these hexagons are not in any logical order within the matrix. The coordinates were retrieved from an STL file which may be the reason why.
<</matlabcentral/answers/uploaded_files/14983/1.png>>
<</matlabcentral/answers/uploaded_files/14984/2.png>>
I’m trying to find the centroid of each of these hexagons and index those six points to its respective centroid. Once I’ve indexed these, I plan on writing some more code to manipulate the six points farther away from their respective centroids – making the hexagons larger and making my structure thicker [ _they are currently too thin_ ] (image 3).
<</matlabcentral/answers/uploaded_files/14985/3.png>>
My problem is the centroid and indexing part. I’ve tried clustering the hexagons into n/6 clusters using the k-means and subclust functions, but there’re always points that do not fall in the center of a hexagon (image 4).
<</matlabcentral/answers/uploaded_files/14986/4.png>>
Would anyone know what I should try?
[I’ve also attached the matrix, in case you would like to play around with the data as well.]I have an nx3 matrix that holds the locations for the vertices of a chain of hexagonal shapes (images 1, 2).
Side-note: The coordinates for the vertices of these hexagons are not in any logical order within the matrix. The coordinates were retrieved from an STL file which may be the reason why.
<</matlabcentral/answers/uploaded_files/14983/1.png>>
<</matlabcentral/answers/uploaded_files/14984/2.png>>
I’m trying to find the centroid of each of these hexagons and index those six points to its respective centroid. Once I’ve indexed these, I plan on writing some more code to manipulate the six points farther away from their respective centroids – making the hexagons larger and making my structure thicker [ _they are currently too thin_ ] (image 3).
<</matlabcentral/answers/uploaded_files/14985/3.png>>
My problem is the centroid and indexing part. I’ve tried clustering the hexagons into n/6 clusters using the k-means and subclust functions, but there’re always points that do not fall in the center of a hexagon (image 4).
<</matlabcentral/answers/uploaded_files/14986/4.png>>
Would anyone know what I should try?
[I’ve also attached the matrix, in case you would like to play around with the data as well.] I have an nx3 matrix that holds the locations for the vertices of a chain of hexagonal shapes (images 1, 2).
Side-note: The coordinates for the vertices of these hexagons are not in any logical order within the matrix. The coordinates were retrieved from an STL file which may be the reason why.
<</matlabcentral/answers/uploaded_files/14983/1.png>>
<</matlabcentral/answers/uploaded_files/14984/2.png>>
I’m trying to find the centroid of each of these hexagons and index those six points to its respective centroid. Once I’ve indexed these, I plan on writing some more code to manipulate the six points farther away from their respective centroids – making the hexagons larger and making my structure thicker [ _they are currently too thin_ ] (image 3).
<</matlabcentral/answers/uploaded_files/14985/3.png>>
My problem is the centroid and indexing part. I’ve tried clustering the hexagons into n/6 clusters using the k-means and subclust functions, but there’re always points that do not fall in the center of a hexagon (image 4).
<</matlabcentral/answers/uploaded_files/14986/4.png>>
Would anyone know what I should try?
[I’ve also attached the matrix, in case you would like to play around with the data as well.] kmeans, centroids, indexing MATLAB Answers — New Questions
Why will MATLAB not start up properly on my Windows based system?
MATLAB will not start up on my Windows system, and I am not receiving license manager errors.MATLAB will not start up on my Windows system, and I am not receiving license manager errors. MATLAB will not start up on my Windows system, and I am not receiving license manager errors. MATLAB Answers — New Questions
Running Tracker GNN in difficult situations
Is there any way we can use trackerGNN and it perfoms well in the case of high false alarms, clutter density and also the additional issues like missed detections and azimithuth errors of radar system itself. What could be the possible techniques to perform robust data association while remaining in the framework of Global Nearest Neighbour Tracking?Is there any way we can use trackerGNN and it perfoms well in the case of high false alarms, clutter density and also the additional issues like missed detections and azimithuth errors of radar system itself. What could be the possible techniques to perform robust data association while remaining in the framework of Global Nearest Neighbour Tracking? Is there any way we can use trackerGNN and it perfoms well in the case of high false alarms, clutter density and also the additional issues like missed detections and azimithuth errors of radar system itself. What could be the possible techniques to perform robust data association while remaining in the framework of Global Nearest Neighbour Tracking? trackergnn MATLAB Answers — New Questions
Random Forest with paired observations: how to maintain subject separation
When using classifiers like SVM, I keep observations from each subject together by using a custom cross-validation partition. Random forest uses bootstrap aggregation instead of cross-validation, so I need a way of telling it to keep each subject’s observations together: i.e. a subject has to be either fully in or out of the bag, not some observations in and some out. How do I do this in Matlab?
I can write code to generate the bootstrapped data that TreeBagger could use for each tree, analogous to a custom CVPartition, but there seems to be no way of passing this to TreeBagger. How does one achieve this in Matlab?
(I do realise that one solution to keep subjects together is to use cross-validation on top of bagging, but that shouldn’t be necessary and greatly slows the whole process down, e.g. 10-fold CV would be expected to take ten times as long. I could also manually roll the whole random forest process, but then I don’t have a TreeBagger object that I can pass to other functions, etc.)
rf = TreeBagger(numTrees, X, Y, …
‘Method’, ‘classification’, …
‘OOBPrediction’, ‘on’, …
‘NumPredictorsToSample’, mtry, …
‘MinLeafSize’, 3)When using classifiers like SVM, I keep observations from each subject together by using a custom cross-validation partition. Random forest uses bootstrap aggregation instead of cross-validation, so I need a way of telling it to keep each subject’s observations together: i.e. a subject has to be either fully in or out of the bag, not some observations in and some out. How do I do this in Matlab?
I can write code to generate the bootstrapped data that TreeBagger could use for each tree, analogous to a custom CVPartition, but there seems to be no way of passing this to TreeBagger. How does one achieve this in Matlab?
(I do realise that one solution to keep subjects together is to use cross-validation on top of bagging, but that shouldn’t be necessary and greatly slows the whole process down, e.g. 10-fold CV would be expected to take ten times as long. I could also manually roll the whole random forest process, but then I don’t have a TreeBagger object that I can pass to other functions, etc.)
rf = TreeBagger(numTrees, X, Y, …
‘Method’, ‘classification’, …
‘OOBPrediction’, ‘on’, …
‘NumPredictorsToSample’, mtry, …
‘MinLeafSize’, 3) When using classifiers like SVM, I keep observations from each subject together by using a custom cross-validation partition. Random forest uses bootstrap aggregation instead of cross-validation, so I need a way of telling it to keep each subject’s observations together: i.e. a subject has to be either fully in or out of the bag, not some observations in and some out. How do I do this in Matlab?
I can write code to generate the bootstrapped data that TreeBagger could use for each tree, analogous to a custom CVPartition, but there seems to be no way of passing this to TreeBagger. How does one achieve this in Matlab?
(I do realise that one solution to keep subjects together is to use cross-validation on top of bagging, but that shouldn’t be necessary and greatly slows the whole process down, e.g. 10-fold CV would be expected to take ten times as long. I could also manually roll the whole random forest process, but then I don’t have a TreeBagger object that I can pass to other functions, etc.)
rf = TreeBagger(numTrees, X, Y, …
‘Method’, ‘classification’, …
‘OOBPrediction’, ‘on’, …
‘NumPredictorsToSample’, mtry, …
‘MinLeafSize’, 3) random forest, pair, separate, bootstrap, bagging MATLAB Answers — New Questions