Tag Archives: matlab
Exporting image-generated geometry in matlab to FEA compatible format
Hello, I am doing an undergraduate thesis, and I like to implement MATLAB in some of the analysis.
The query is, how to export a file generated as an image in a code, to a format compatible with FEA (Finite element analysis).
The goal is to find the temperature profile in this slag pot geometry, which is a truncated cone.
So, once having the compatible geometry I can use matlab pdegplot and some commands related to find the temperature profile.
The code was generated by AI (Claude).
% Dibujo tronco de cono en 3D. Luego, obtener el perfil de temperatura y
% modelamiento de pérdida de calor mediante el uso de ecuaciones
% diferenciales.
% Parámetros del problema
R1 = 1.155; % Semi-eje mayor de la elipse menor (m)
R2 = 2.082; % Semi-eje mayor de la elipse mayor (m)
b1 = 1.549; % Semi-eje menor de la elipse mayor (m)
b2 = 0.838; % Semi-eje menor de la elipse menor (m)
h = 2.921; % Altura del tronco de cono (m)
theta = linspace(0, 2*pi, 100); % Ángulo para las elipses
% Coordenadas para la elipse menor (base inferior)
x1 = R1 * cos(theta);
y1 = b2 * sin(theta);
z1 = zeros(size(theta));
% Coordenadas para la elipse mayor (base superior)
x2 = R2 * cos(theta);
y2 = b1 * sin(theta);
z2 = h * ones(size(theta));
% Superficie lateral del tronco de cono
[Theta, Z] = meshgrid(theta, linspace(0, h, 100));
R = (R2 – R1) / h * Z + R1;
B = (b1 – b2) / h * Z + b2;
X = R .* cos(Theta);
Y = B .* sin(Theta);
% Graficar el tronco de cono
figure;
hold on;
surf(X, Y, Z, ‘EdgeColor’, ‘none’, ‘FaceAlpha’, 0.7); % Superficie lateral
fill3(x1, y1, z1, ‘r’); % Base inferior
fill3(x2, y2, z2, ‘b’); % Base superior
xlabel(‘X (m)’);
ylabel(‘Y (m)’);
zlabel(‘Z (m)’);
title(‘Tronco de Cono con Bases Elípticas’);
axis equal;
grid on;
hold off;Hello, I am doing an undergraduate thesis, and I like to implement MATLAB in some of the analysis.
The query is, how to export a file generated as an image in a code, to a format compatible with FEA (Finite element analysis).
The goal is to find the temperature profile in this slag pot geometry, which is a truncated cone.
So, once having the compatible geometry I can use matlab pdegplot and some commands related to find the temperature profile.
The code was generated by AI (Claude).
% Dibujo tronco de cono en 3D. Luego, obtener el perfil de temperatura y
% modelamiento de pérdida de calor mediante el uso de ecuaciones
% diferenciales.
% Parámetros del problema
R1 = 1.155; % Semi-eje mayor de la elipse menor (m)
R2 = 2.082; % Semi-eje mayor de la elipse mayor (m)
b1 = 1.549; % Semi-eje menor de la elipse mayor (m)
b2 = 0.838; % Semi-eje menor de la elipse menor (m)
h = 2.921; % Altura del tronco de cono (m)
theta = linspace(0, 2*pi, 100); % Ángulo para las elipses
% Coordenadas para la elipse menor (base inferior)
x1 = R1 * cos(theta);
y1 = b2 * sin(theta);
z1 = zeros(size(theta));
% Coordenadas para la elipse mayor (base superior)
x2 = R2 * cos(theta);
y2 = b1 * sin(theta);
z2 = h * ones(size(theta));
% Superficie lateral del tronco de cono
[Theta, Z] = meshgrid(theta, linspace(0, h, 100));
R = (R2 – R1) / h * Z + R1;
B = (b1 – b2) / h * Z + b2;
X = R .* cos(Theta);
Y = B .* sin(Theta);
% Graficar el tronco de cono
figure;
hold on;
surf(X, Y, Z, ‘EdgeColor’, ‘none’, ‘FaceAlpha’, 0.7); % Superficie lateral
fill3(x1, y1, z1, ‘r’); % Base inferior
fill3(x2, y2, z2, ‘b’); % Base superior
xlabel(‘X (m)’);
ylabel(‘Y (m)’);
zlabel(‘Z (m)’);
title(‘Tronco de Cono con Bases Elípticas’);
axis equal;
grid on;
hold off; Hello, I am doing an undergraduate thesis, and I like to implement MATLAB in some of the analysis.
The query is, how to export a file generated as an image in a code, to a format compatible with FEA (Finite element analysis).
The goal is to find the temperature profile in this slag pot geometry, which is a truncated cone.
So, once having the compatible geometry I can use matlab pdegplot and some commands related to find the temperature profile.
The code was generated by AI (Claude).
% Dibujo tronco de cono en 3D. Luego, obtener el perfil de temperatura y
% modelamiento de pérdida de calor mediante el uso de ecuaciones
% diferenciales.
% Parámetros del problema
R1 = 1.155; % Semi-eje mayor de la elipse menor (m)
R2 = 2.082; % Semi-eje mayor de la elipse mayor (m)
b1 = 1.549; % Semi-eje menor de la elipse mayor (m)
b2 = 0.838; % Semi-eje menor de la elipse menor (m)
h = 2.921; % Altura del tronco de cono (m)
theta = linspace(0, 2*pi, 100); % Ángulo para las elipses
% Coordenadas para la elipse menor (base inferior)
x1 = R1 * cos(theta);
y1 = b2 * sin(theta);
z1 = zeros(size(theta));
% Coordenadas para la elipse mayor (base superior)
x2 = R2 * cos(theta);
y2 = b1 * sin(theta);
z2 = h * ones(size(theta));
% Superficie lateral del tronco de cono
[Theta, Z] = meshgrid(theta, linspace(0, h, 100));
R = (R2 – R1) / h * Z + R1;
B = (b1 – b2) / h * Z + b2;
X = R .* cos(Theta);
Y = B .* sin(Theta);
% Graficar el tronco de cono
figure;
hold on;
surf(X, Y, Z, ‘EdgeColor’, ‘none’, ‘FaceAlpha’, 0.7); % Superficie lateral
fill3(x1, y1, z1, ‘r’); % Base inferior
fill3(x2, y2, z2, ‘b’); % Base superior
xlabel(‘X (m)’);
ylabel(‘Y (m)’);
zlabel(‘Z (m)’);
title(‘Tronco de Cono con Bases Elípticas’);
axis equal;
grid on;
hold off; matlab, 3d plots, export MATLAB Answers — New Questions
World magnetic model frame of reference??
I am using the world magnetic model function wrldmagm as part of a scrip, but the help page that describes the function provides no information about the reference frame used for the magnetic vector. The simulink block seems to use North-East-Down, would it be safe to assume that the script function does the same?I am using the world magnetic model function wrldmagm as part of a scrip, but the help page that describes the function provides no information about the reference frame used for the magnetic vector. The simulink block seems to use North-East-Down, would it be safe to assume that the script function does the same? I am using the world magnetic model function wrldmagm as part of a scrip, but the help page that describes the function provides no information about the reference frame used for the magnetic vector. The simulink block seems to use North-East-Down, would it be safe to assume that the script function does the same? worldmagneticmodel MATLAB Answers — New Questions
Calling a function with no arguments
Hi All,
In my program , I’m trying to call a function with some input arguments but no outputs as I’m using this function for the purpose of plotting.
How should its syntax look like?
[ ] = function_name( var1,var2,var3) // This line is giving me erorr : Assigning an output to an empty array is not supported.
Please suggest me a way to handle this error.
Thanks in advance!Hi All,
In my program , I’m trying to call a function with some input arguments but no outputs as I’m using this function for the purpose of plotting.
How should its syntax look like?
[ ] = function_name( var1,var2,var3) // This line is giving me erorr : Assigning an output to an empty array is not supported.
Please suggest me a way to handle this error.
Thanks in advance! Hi All,
In my program , I’m trying to call a function with some input arguments but no outputs as I’m using this function for the purpose of plotting.
How should its syntax look like?
[ ] = function_name( var1,var2,var3) // This line is giving me erorr : Assigning an output to an empty array is not supported.
Please suggest me a way to handle this error.
Thanks in advance! function MATLAB Answers — New Questions
Why do I get errors related to Updaters during the Hardware Setup of the “Embedded Coder Support Package for STMicroelectronics STM32 Processors”?
I installed the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", but I am unable to complete the Hardware Setup.
At the "Install STM32Cube Firmware" stage, I click the "Install" button and get error such as the following:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] WebUtils:643 – Updater is busy
[ERROR] HomeAdPanel:114 – Failed to refresh advertisement data
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] MainUpdater:2088 – Updater is busy
Or:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[ERROR] Engine:463 – C:UsersPede.stm32cubemxthirdpartiespdscEmbeddedOffice.I-CUBE-FS-RTOS.1.0.1.pdsc:
PDSC version is not supported
swmgr refresh
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[INFO] CheckServerUpdateThread:115 – End of CheckServer Thread
[INFO] LoadServerUpdatesThread:339 – End of LoadServerUpdate ThreadI installed the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", but I am unable to complete the Hardware Setup.
At the "Install STM32Cube Firmware" stage, I click the "Install" button and get error such as the following:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] WebUtils:643 – Updater is busy
[ERROR] HomeAdPanel:114 – Failed to refresh advertisement data
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] MainUpdater:2088 – Updater is busy
Or:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[ERROR] Engine:463 – C:UsersPede.stm32cubemxthirdpartiespdscEmbeddedOffice.I-CUBE-FS-RTOS.1.0.1.pdsc:
PDSC version is not supported
swmgr refresh
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[INFO] CheckServerUpdateThread:115 – End of CheckServer Thread
[INFO] LoadServerUpdatesThread:339 – End of LoadServerUpdate Thread I installed the "Embedded Coder Support Package for STMicroelectronics STM32 Processors", but I am unable to complete the Hardware Setup.
At the "Install STM32Cube Firmware" stage, I click the "Install" button and get error such as the following:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] WebUtils:643 – Updater is busy
[ERROR] HomeAdPanel:114 – Failed to refresh advertisement data
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] WebUtils:384 – Updater is busy
[ERROR] MainUpdater:2088 – Updater is busy
Or:
[ERROR] AnalyticsContext:980 – The ST intranet updater server is unknown: mcucrossselector.codex.cro.st.com
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[ERROR] Engine:463 – C:UsersPede.stm32cubemxthirdpartiespdscEmbeddedOffice.I-CUBE-FS-RTOS.1.0.1.pdsc:
PDSC version is not supported
swmgr refresh
[ERROR] ServerAccessManage:1058 – Problem during Server Connexion : IO error PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] ServerAccessManage:537 – Problem during Server Connexion : : updaters.zip.
[ERROR] ServerAccessManage:1032 – Warning during Server Connexion : Unknown host www.ebuc23.com
[ERROR] ServerAccessManage:537 – Unknown host server name. : updaters.zip.
[INFO] CheckServerUpdateThread:115 – End of CheckServer Thread
[INFO] LoadServerUpdatesThread:339 – End of LoadServerUpdate Thread MATLAB Answers — New Questions
Why I can’t save my data in a .mat when using WebAppServer?
My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks!My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks! My application is used to take a test to several people.
At each instance, Scores.mat is opened. It contains the structure Scores which stores the scores of the previous participants. The number of participants is retrieved. The new participant takes the test and the new scores are added to the strucure Scores. At the end of the test, the structure Scores is saved in Scores.mat, and so on.
% Load the scores table
load Scores.mat
app.Scores = Scores;
% Increment the participant index
app.idxParticipant = length(app.Scores) + 1;
% (…)
% Save scores (code has been modified for better clarity)
app.Scores(app.idxParticipant).Model(1) = app.EditField.Value;
app.Scores(app.idxParticipant).Model(2) = app.EditField_2.Value;
app.Scores(app.idxParticipant).Model(3) = app.EditField_3.Value;
% (…)
% Save listener scores
Scores = app.Scores;
save(‘Scores.mat’,’Scores’)
Locally, everything runs well, of course. But when I test the Matlab WebApp, the very last step doesn’t work: the structure Scores is not saved in Scores.mat and there is no errors in the logs.
Scores.mat is well embedded in the WebApp as I am able to open it and retrieve the Scores structure. The structure is well updated, I’ve checked it, but I am not able to save the updated structure back into Scores.mat.
I hope someone could help me here. Many thanks! wepappserver MATLAB Answers — New Questions
Why do I receive the error “This email is not linked to a license. Use a different email address…” when I try to launch MATLAB?
Why do I see the following error when I try to launch MATLAB?
This email is not linked to a license.
Use a different email address or go to your MathWorks Account to link a license. After the license is linked, try again.Why do I see the following error when I try to launch MATLAB?
This email is not linked to a license.
Use a different email address or go to your MathWorks Account to link a license. After the license is linked, try again. Why do I see the following error when I try to launch MATLAB?
This email is not linked to a license.
Use a different email address or go to your MathWorks Account to link a license. After the license is linked, try again. MATLAB Answers — New Questions
Correspondence between student name and Learner ID in Matlab Grader and Moodle
We are using Matlab Grader in a Moodle platform. Though we are able to detect and give feedback for most of the common errors made by our students, teachers often need to revise the code of individual students. The correspondence between Matlab Grader’s Learner ID and student’s names in Moodle must be stablished somewhere. Can we access this information? Asking our students to submit their Solution ID, a solution that I’ve seen in several of the questions posted to this community, is just not an option. The procedure ought to be automatized somehow, probably by our Moodle platform managers, but is this possible?
Best regardsWe are using Matlab Grader in a Moodle platform. Though we are able to detect and give feedback for most of the common errors made by our students, teachers often need to revise the code of individual students. The correspondence between Matlab Grader’s Learner ID and student’s names in Moodle must be stablished somewhere. Can we access this information? Asking our students to submit their Solution ID, a solution that I’ve seen in several of the questions posted to this community, is just not an option. The procedure ought to be automatized somehow, probably by our Moodle platform managers, but is this possible?
Best regards We are using Matlab Grader in a Moodle platform. Though we are able to detect and give feedback for most of the common errors made by our students, teachers often need to revise the code of individual students. The correspondence between Matlab Grader’s Learner ID and student’s names in Moodle must be stablished somewhere. Can we access this information? Asking our students to submit their Solution ID, a solution that I’ve seen in several of the questions posted to this community, is just not an option. The procedure ought to be automatized somehow, probably by our Moodle platform managers, but is this possible?
Best regards matlab grader, learner id, moodle MATLAB Answers — New Questions
how to simulate parallel inverters with different power rating ?
Hello !
I am trying to simulate a micgrogrid in which 3 pv inverters connected in parallel. Aim is to detect the island operation and to study the performance of parallel inverters. I want to make transition smooth from grid forming to grid feeding or vice versa, making a suitable control strategy and then want to improve the power quality of such microgrid. I need help in accurate simulation. Lookig for kindness in this regard if someone has worked on this problem. Pls contact me on ghh559953@gmail.comHello !
I am trying to simulate a micgrogrid in which 3 pv inverters connected in parallel. Aim is to detect the island operation and to study the performance of parallel inverters. I want to make transition smooth from grid forming to grid feeding or vice versa, making a suitable control strategy and then want to improve the power quality of such microgrid. I need help in accurate simulation. Lookig for kindness in this regard if someone has worked on this problem. Pls contact me on ghh559953@gmail.com Hello !
I am trying to simulate a micgrogrid in which 3 pv inverters connected in parallel. Aim is to detect the island operation and to study the performance of parallel inverters. I want to make transition smooth from grid forming to grid feeding or vice versa, making a suitable control strategy and then want to improve the power quality of such microgrid. I need help in accurate simulation. Lookig for kindness in this regard if someone has worked on this problem. Pls contact me on ghh559953@gmail.com all MATLAB Answers — New Questions
what is the difference between monostatic RCS and bistatic RCS?
I am currently working in MATLAB POFACETS, I know what is monostatic RADAR and what is Bistatic RADAR. But why is the radar cross section differs based on type of radar we use? Does RCS should be constant even if we use bistatic or monostatic configuration? after all backsctatter is a part of bistatic RCS calculations right?I am currently working in MATLAB POFACETS, I know what is monostatic RADAR and what is Bistatic RADAR. But why is the radar cross section differs based on type of radar we use? Does RCS should be constant even if we use bistatic or monostatic configuration? after all backsctatter is a part of bistatic RCS calculations right? I am currently working in MATLAB POFACETS, I know what is monostatic RADAR and what is Bistatic RADAR. But why is the radar cross section differs based on type of radar we use? Does RCS should be constant even if we use bistatic or monostatic configuration? after all backsctatter is a part of bistatic RCS calculations right? phased array MATLAB Answers — New Questions
Link req to verify statement in a test sequence
Hello,
Is it possible to link a requirement to a verify statement from a test sequence block?
Tnx much for support!
DianaHello,
Is it possible to link a requirement to a verify statement from a test sequence block?
Tnx much for support!
Diana Hello,
Is it possible to link a requirement to a verify statement from a test sequence block?
Tnx much for support!
Diana simulink test, simulink coverage MATLAB Answers — New Questions
How i can modified this App designer file in which RLC added like = [0.01, 10,15, 0.01] and time interval also like [ 10, 50; 50, 100; 100, 200; 200, 300] each single field.
How i can modified this App designer file in which RLC added like = [0.01, 10,15, 0.01] and time interval also like [ 10, 50; 50, 100; 100, 200; 200, 300] each in a single field. Kindly help me outHow i can modified this App designer file in which RLC added like = [0.01, 10,15, 0.01] and time interval also like [ 10, 50; 50, 100; 100, 200; 200, 300] each in a single field. Kindly help me out How i can modified this App designer file in which RLC added like = [0.01, 10,15, 0.01] and time interval also like [ 10, 50; 50, 100; 100, 200; 200, 300] each in a single field. Kindly help me out matlab gui, appdesigner MATLAB Answers — New Questions
Vertical blank space in tiledlayout compact
Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas?Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas? Dear all
I am plotting the following:
u1=figure(‘visible’,’off’,’units’,’pixels’,’position’,[0 0 1920 1080]);
t=tiledlayout(2,2,’Padding’,’compact’);
title(t,[‘Bilayer. Monte Carlo, $15$ million steps. $T=2$ K, $mathbf{H}=0$’;”;”],’FontSize’,18,’interpreter’,’latex’);
ax1=nexttile;
uimagesc(space_x,space_y,mx);
axis xy;
clim([-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
colormap(ax1,bluewhitered(256));
box on;
clr1=colorbar(‘YTick’,[-round(max([abs(max(max(mx))) abs(min(min(mx)))]),2) -round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) 0 round(max([abs(max(max(mx))) abs(min(min(mx)))])/2,2) round(max([abs(max(max(mx))) abs(min(min(mx)))]),2)]);
set(clr1,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr1,’$a$-{it th} magnetization component, $m_a$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax2=nexttile;
uimagesc(space_x,space_y,my);
clim([-max([abs(max(max(my))) abs(min(min(my)))]) max([abs(max(max(my))) abs(min(min(my)))])]);
colormap(ax2,bluewhitered(256));
axis xy;
box on;
clr2=colorbar(‘YTick’,[-max([abs(max(max(my))) abs(min(min(my)))]) -max([abs(max(max(my))) abs(min(min(my)))])/2 0 max([abs(max(max(my))) abs(min(min(my)))])/2 max([abs(max(max(my))) abs(min(min(my)))])]);
set(clr2,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr2,’$b$-{it th} magnetization component, $m_b$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax3=nexttile;
uimagesc(space_x,space_y,mz);
box on;
axis xy;
clim([-max([abs(max(max(mz))) abs(min(min(mz)))]) max([abs(max(max(mz))) abs(min(min(mz)))])]);
colormap(ax3,bluewhitered(256));
clr3=colorbar(‘YTick’,[-max([abs(max(max(mz))) abs(min(min(mz)))]) -max([abs(max(max(mz))) abs(min(min(mz)))])/2 0 max([abs(max(max(mz))) abs(min(min(mz)))])/2 max([abs(max(max(mz))) abs(min(min(mz)))])]);
set(clr3,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr3,’$z$-{it th} magnetization component, $m_z$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
ax4=nexttile;
uimagesc(space_x,space_y,total_magnetization);
box on;
axis xy;
clim([0 max(max(total_magnetization))]);
colormap(ax4,cmap);
clr4=colorbar(‘YTick’,[0 max(max(total_magnetization))/5 2*max(max(total_magnetization))/5 3*max(max(total_magnetization))/5 4*max(max(total_magnetization))/5 max(max(total_magnetization))]);
set(clr4,’TickLabelInterpreter’,’latex’);
xlabel(‘$a$-{it th} spatial direction, $a , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(‘$b$-{it th} spatial direction, $b , , left( mathrm{nm} right)$’,’FontSize’,15,’interpreter’,’latex’);
ylabel(clr4,’Magnetization vector modulus, $left| mathbf{m} right|$’,’Interpreter’,’Latex’,’FontSize’,16);
xlim([0 300]);
xticks([0:50:300]);
ylim([0 100]);
yticks([0:20:100]);
pbaspect([1 1/3 1]);
xtickangle(0);
set(gca,’TickLabelInterpreter’,’latex’,’FontSize’,15);
set(gcf,’color’,’white’);
set(gca,’Units’,’normalized’);
set(u1,’Units’,’Inches’);
posu1=get(u1,’Position’);
set(u1,’PaperPositionMode’,’Auto’,’PaperUnits’,’Inches’,’PaperSize’,[posu1(3),posu1(4)]);
and the plot looks like:
As you can see there is some vertical unnecessary space between the two horizontal stacks of plots. I would like to reduce it to be able to put the general title "Bilayer…" far enough from the top plots.
Any ideas? padding compact tiledlayout MATLAB Answers — New Questions
How can I install MATLAB without the default JRE?
I noticed that MATLAB does not ship with the newest version of the Java Runtime Environment.Can I install a newer JRE and configure MATLAB to use it?I noticed that MATLAB does not ship with the newest version of the Java Runtime Environment.Can I install a newer JRE and configure MATLAB to use it? I noticed that MATLAB does not ship with the newest version of the Java Runtime Environment.Can I install a newer JRE and configure MATLAB to use it? MATLAB Answers — New Questions
Untraining the SalsaNext model Architecture
I used the following repository to evaluate my data (https://github.com/matlab-deep-learning/pretrained-salsanext), but it loads a pretrained SalsaNext model. I would like to know whether it is possible to untrain the model, or to train it from scratch without creating the layergraph (Since this model involves a large number of layers, and the work seems to be cumbersome, and error-prone).
ThanksI used the following repository to evaluate my data (https://github.com/matlab-deep-learning/pretrained-salsanext), but it loads a pretrained SalsaNext model. I would like to know whether it is possible to untrain the model, or to train it from scratch without creating the layergraph (Since this model involves a large number of layers, and the work seems to be cumbersome, and error-prone).
Thanks I used the following repository to evaluate my data (https://github.com/matlab-deep-learning/pretrained-salsanext), but it loads a pretrained SalsaNext model. I would like to know whether it is possible to untrain the model, or to train it from scratch without creating the layergraph (Since this model involves a large number of layers, and the work seems to be cumbersome, and error-prone).
Thanks salsanext, untraining, neural network MATLAB Answers — New Questions
Designing fuzzy inference system and subsystems
Hello.I have several fuzzy systems about security, all of which have 3 outputs: weak, medium and strong. In the comprehensive system, I want to enter all these fuzzy systems and in addition ask it to calculate if it sees 10 weak cases, the final output will be the vulnerable level. Is this possible? Can you guide me?Hello.I have several fuzzy systems about security, all of which have 3 outputs: weak, medium and strong. In the comprehensive system, I want to enter all these fuzzy systems and in addition ask it to calculate if it sees 10 weak cases, the final output will be the vulnerable level. Is this possible? Can you guide me? Hello.I have several fuzzy systems about security, all of which have 3 outputs: weak, medium and strong. In the comprehensive system, I want to enter all these fuzzy systems and in addition ask it to calculate if it sees 10 weak cases, the final output will be the vulnerable level. Is this possible? Can you guide me? fuzzy inference system, fuzzy MATLAB Answers — New Questions
“Does the rotor core of the Synchronous Machine Model 1.0 include hysteresis characteristics?”
I am using the Synchronous Machine Model 1.0 in Simulink Simscape.
Does the rotor core of the Synchronous Machine Model 1.0 include hysteresis characteristics?I am using the Synchronous Machine Model 1.0 in Simulink Simscape.
Does the rotor core of the Synchronous Machine Model 1.0 include hysteresis characteristics? I am using the Synchronous Machine Model 1.0 in Simulink Simscape.
Does the rotor core of the Synchronous Machine Model 1.0 include hysteresis characteristics? simulink, simscape, electric_motor_control, model MATLAB Answers — New Questions
Problem with single agent Simulink using RL toolbox
I am using RL toolbox to train a single agent with the following specifications:
for type=1
% obsMat = [1 1];
obsMat = [4 3; 5 3; 6 3; 7 3; 8 3; 9 3; 5 11; 6 11; 7 11; 8 11; 6 12; 7 12; 3 12; ];
% obsMat = [ ];
sA0 = [2 5];
switch type
case 1
s0 = [sA0];
end
Ts = 0.1;
Tf = 100;
maxsteps = ceil(Tf/Ts);
switch type
case 1
mdl = "rlAreaCoverage1";
end
open_system(mdl)
% Define observation specifications.
obsSize = [12 12 4];
oinfo = rlNumericSpec(obsSize);
oinfo.Name = "observations";
% Define action specifications.
numAct=131
switch numAct
case 131
actionSpace = {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 129 130 131 132 133 134 136 137 140 141 142 143 144};
end
ainfo = rlFiniteSetSpec(actionSpace);
ainfo.Name = "actions";
switch type
case 1
blks = mdl + ["/Agent A (Red)"];
end
switch type
case 1
env = rlSimulinkEnv(mdl,blks,{oinfo},{ainfo});
end
env.ResetFcn = @(in) resetMap(in, obsMat);
rng(0)
but I see this error:
Error using rlSimulinkEnv>localValidateIOSpecs (line 178)
Invalid size or type for observation specification.
Error in rlSimulinkEnv (line 90)
localValidateIOSpecs(numAgents,observationInfo,actionInfo);
Do you have any idea what is wrong in my setup?I am using RL toolbox to train a single agent with the following specifications:
for type=1
% obsMat = [1 1];
obsMat = [4 3; 5 3; 6 3; 7 3; 8 3; 9 3; 5 11; 6 11; 7 11; 8 11; 6 12; 7 12; 3 12; ];
% obsMat = [ ];
sA0 = [2 5];
switch type
case 1
s0 = [sA0];
end
Ts = 0.1;
Tf = 100;
maxsteps = ceil(Tf/Ts);
switch type
case 1
mdl = "rlAreaCoverage1";
end
open_system(mdl)
% Define observation specifications.
obsSize = [12 12 4];
oinfo = rlNumericSpec(obsSize);
oinfo.Name = "observations";
% Define action specifications.
numAct=131
switch numAct
case 131
actionSpace = {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 129 130 131 132 133 134 136 137 140 141 142 143 144};
end
ainfo = rlFiniteSetSpec(actionSpace);
ainfo.Name = "actions";
switch type
case 1
blks = mdl + ["/Agent A (Red)"];
end
switch type
case 1
env = rlSimulinkEnv(mdl,blks,{oinfo},{ainfo});
end
env.ResetFcn = @(in) resetMap(in, obsMat);
rng(0)
but I see this error:
Error using rlSimulinkEnv>localValidateIOSpecs (line 178)
Invalid size or type for observation specification.
Error in rlSimulinkEnv (line 90)
localValidateIOSpecs(numAgents,observationInfo,actionInfo);
Do you have any idea what is wrong in my setup? I am using RL toolbox to train a single agent with the following specifications:
for type=1
% obsMat = [1 1];
obsMat = [4 3; 5 3; 6 3; 7 3; 8 3; 9 3; 5 11; 6 11; 7 11; 8 11; 6 12; 7 12; 3 12; ];
% obsMat = [ ];
sA0 = [2 5];
switch type
case 1
s0 = [sA0];
end
Ts = 0.1;
Tf = 100;
maxsteps = ceil(Tf/Ts);
switch type
case 1
mdl = "rlAreaCoverage1";
end
open_system(mdl)
% Define observation specifications.
obsSize = [12 12 4];
oinfo = rlNumericSpec(obsSize);
oinfo.Name = "observations";
% Define action specifications.
numAct=131
switch numAct
case 131
actionSpace = {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 129 130 131 132 133 134 136 137 140 141 142 143 144};
end
ainfo = rlFiniteSetSpec(actionSpace);
ainfo.Name = "actions";
switch type
case 1
blks = mdl + ["/Agent A (Red)"];
end
switch type
case 1
env = rlSimulinkEnv(mdl,blks,{oinfo},{ainfo});
end
env.ResetFcn = @(in) resetMap(in, obsMat);
rng(0)
but I see this error:
Error using rlSimulinkEnv>localValidateIOSpecs (line 178)
Invalid size or type for observation specification.
Error in rlSimulinkEnv (line 90)
localValidateIOSpecs(numAgents,observationInfo,actionInfo);
Do you have any idea what is wrong in my setup? reinforcement learning MATLAB Answers — New Questions
I want to plot the auto correlation function for 15 numbers without using the inbuilt function. My series is P=[ 47,64,23,71,38,64,55,41,59,48,71,35,57,40,58 ] and the plot should be autocorrelation function vs lags.
I want to plot the auto correlation function for 15 numbers without using the inbuilt function.
My code is as follows:
P=[ 47,64,23,71,38,64,55,41,59,48]; %%,71,35,57,40,58 ];
N=length(P);
Q=P(1:N);
R=P(1:N);
N1=length(Q);
N2=length(R);
u=mean(P);
sum= ((Q-u)*(R-u).’);
covar0=sum/N1;
for k=1:N-1 %% k is no. of lags and its max value can be 14 here
Q1=P(1:N-k); %% Splitting the series into 2 series separated by lag k
R1=P(1+k:N);
N1_1=length(Q1);
N2_1=length(R1);
sum1= ((Q1-u)*(R1-u).’);
covark=sum1/N;
acf=covark/covar0;
acf;
end
But after execution of the loop,I am getting acf value only for last value of k, which rather should have been an array for values of k=1 to 14.
I am new to matlab. Plz help me resolve the code.I want to plot the auto correlation function for 15 numbers without using the inbuilt function.
My code is as follows:
P=[ 47,64,23,71,38,64,55,41,59,48]; %%,71,35,57,40,58 ];
N=length(P);
Q=P(1:N);
R=P(1:N);
N1=length(Q);
N2=length(R);
u=mean(P);
sum= ((Q-u)*(R-u).’);
covar0=sum/N1;
for k=1:N-1 %% k is no. of lags and its max value can be 14 here
Q1=P(1:N-k); %% Splitting the series into 2 series separated by lag k
R1=P(1+k:N);
N1_1=length(Q1);
N2_1=length(R1);
sum1= ((Q1-u)*(R1-u).’);
covark=sum1/N;
acf=covark/covar0;
acf;
end
But after execution of the loop,I am getting acf value only for last value of k, which rather should have been an array for values of k=1 to 14.
I am new to matlab. Plz help me resolve the code. I want to plot the auto correlation function for 15 numbers without using the inbuilt function.
My code is as follows:
P=[ 47,64,23,71,38,64,55,41,59,48]; %%,71,35,57,40,58 ];
N=length(P);
Q=P(1:N);
R=P(1:N);
N1=length(Q);
N2=length(R);
u=mean(P);
sum= ((Q-u)*(R-u).’);
covar0=sum/N1;
for k=1:N-1 %% k is no. of lags and its max value can be 14 here
Q1=P(1:N-k); %% Splitting the series into 2 series separated by lag k
R1=P(1+k:N);
N1_1=length(Q1);
N2_1=length(R1);
sum1= ((Q1-u)*(R1-u).’);
covark=sum1/N;
acf=covark/covar0;
acf;
end
But after execution of the loop,I am getting acf value only for last value of k, which rather should have been an array for values of k=1 to 14.
I am new to matlab. Plz help me resolve the code. auto correlation, for loop MATLAB Answers — New Questions
Different filters for pretrainned network
if i have a group of images and i filtered all of them with 8 different filters , is there a way or method or a published something or calculate a fator to know me which filtered group is best with specific pretrainned transfer learning network for classification task using matlab without training the network with each group of filtered imagesif i have a group of images and i filtered all of them with 8 different filters , is there a way or method or a published something or calculate a fator to know me which filtered group is best with specific pretrainned transfer learning network for classification task using matlab without training the network with each group of filtered images if i have a group of images and i filtered all of them with 8 different filters , is there a way or method or a published something or calculate a fator to know me which filtered group is best with specific pretrainned transfer learning network for classification task using matlab without training the network with each group of filtered images filtering pretrainned MATLAB Answers — New Questions
How to display Chart diagram in a report, using report generator?
Hi,
I have a problem with the visualization of Chart diagram and related properties in my model.
I using this code line (in a matlab script) to search all the subsystem object (including chart):
allsubsysObj = modelObj.find(‘-isa’,’Simulink.SubSystem’,’-or’,’-isa’,’Simulink.ModelReference’,’-depth’,1);
The script find the number of element that i’m expected (2 chart and 2 subsytem) but when i tried to put the diagram figure i obtained the inner content of the subsytem and the chart.
auxpara = CenterDiagram(Diagram(allsubsysObj(1)),R);
Cap = Text(strcat("Figure ",num2str(ChCounter),".",num2str(FigCounter),": ",allsubsysObj(1).Name," subsystem"));
Cap.Style = [{FontSize(Str.CapFontSize)},{Color(Str.CapColor)},{Bold(true)},{HAlign(Str.CapAlign)}];
FigCounter = FigCounter + 1;
subsec.add(auxpara);
subsec.add(Cap);
subsec.add(LineBreak());
How i can insert only the top level diagram of the chart?Hi,
I have a problem with the visualization of Chart diagram and related properties in my model.
I using this code line (in a matlab script) to search all the subsystem object (including chart):
allsubsysObj = modelObj.find(‘-isa’,’Simulink.SubSystem’,’-or’,’-isa’,’Simulink.ModelReference’,’-depth’,1);
The script find the number of element that i’m expected (2 chart and 2 subsytem) but when i tried to put the diagram figure i obtained the inner content of the subsytem and the chart.
auxpara = CenterDiagram(Diagram(allsubsysObj(1)),R);
Cap = Text(strcat("Figure ",num2str(ChCounter),".",num2str(FigCounter),": ",allsubsysObj(1).Name," subsystem"));
Cap.Style = [{FontSize(Str.CapFontSize)},{Color(Str.CapColor)},{Bold(true)},{HAlign(Str.CapAlign)}];
FigCounter = FigCounter + 1;
subsec.add(auxpara);
subsec.add(Cap);
subsec.add(LineBreak());
How i can insert only the top level diagram of the chart? Hi,
I have a problem with the visualization of Chart diagram and related properties in my model.
I using this code line (in a matlab script) to search all the subsystem object (including chart):
allsubsysObj = modelObj.find(‘-isa’,’Simulink.SubSystem’,’-or’,’-isa’,’Simulink.ModelReference’,’-depth’,1);
The script find the number of element that i’m expected (2 chart and 2 subsytem) but when i tried to put the diagram figure i obtained the inner content of the subsytem and the chart.
auxpara = CenterDiagram(Diagram(allsubsysObj(1)),R);
Cap = Text(strcat("Figure ",num2str(ChCounter),".",num2str(FigCounter),": ",allsubsysObj(1).Name," subsystem"));
Cap.Style = [{FontSize(Str.CapFontSize)},{Color(Str.CapColor)},{Bold(true)},{HAlign(Str.CapAlign)}];
FigCounter = FigCounter + 1;
subsec.add(auxpara);
subsec.add(Cap);
subsec.add(LineBreak());
How i can insert only the top level diagram of the chart? report generation MATLAB Answers — New Questions