Category: Matlab
Category Archives: Matlab
Storing data to flash on F280039C from a Simulink model
I am currently trying to store parameters of a recursive regression model created in Simulink to some sort of nonvolatile memory on the TI C2000 gen3 / F280039C board, such that the calculations can continue after turning the device off and on again. I have found an EEPROM emulation project from mathworks (https://ch.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000), which is however made for a different board and older generation of the TI C2000.
Is there any possibility to port this project to my newer board, or other ways to store my data in a nonvolatile manner from Simulink? What do I need to take into consideration when doing this?I am currently trying to store parameters of a recursive regression model created in Simulink to some sort of nonvolatile memory on the TI C2000 gen3 / F280039C board, such that the calculations can continue after turning the device off and on again. I have found an EEPROM emulation project from mathworks (https://ch.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000), which is however made for a different board and older generation of the TI C2000.
Is there any possibility to port this project to my newer board, or other ways to store my data in a nonvolatile manner from Simulink? What do I need to take into consideration when doing this? I am currently trying to store parameters of a recursive regression model created in Simulink to some sort of nonvolatile memory on the TI C2000 gen3 / F280039C board, such that the calculations can continue after turning the device off and on again. I have found an EEPROM emulation project from mathworks (https://ch.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000), which is however made for a different board and older generation of the TI C2000.
Is there any possibility to port this project to my newer board, or other ways to store my data in a nonvolatile manner from Simulink? What do I need to take into consideration when doing this? f280039c eeprom emulation, ti-c2000 eeprom emulation, f280039c nonvolatile memory, ti-c2000 nonvolatile memory MATLAB Answers — New Questions
How to convert something from Latex to matlab, is there a specific way where i can convert it with ease from latex to matlab, some function? please help
is there a specific way where i can convert it with ease from latex to matlab
an example of an equation i want to know how can i write it in matlab form from latex
example 1:
begin{equation} h_{k}=frac {A(m+1)}{2 pi d_{k}^{2}}cos ^{m}(phi _{k})T(psi _{k})g(psi _{k})cos (psi _{k}), end{equation}
example 2:
begin{align} tilde {R}_{k rightarrow j}!=! begin{cases} !! frac {B}{2} log _{2}left ({1 + frac {left ({ h_{k} a_{j} }right )^{2}} {sum _{i=j+1}^{K}left ({ h_{k} a_{i} }right )^{2} + varepsilon sum _{i=1}^{j-1}left ({ h_{k} a_{i} }right )^{2}+ 1/rho } }right ) geq T_{j},\ qquad j leq k,j neq K;\ !! frac {B}{2}log _{2} left ({! 1!+!frac {left ({ h_{K} a_{j} }right )^{2}} {varepsilon sum _{i=1}^{j-1}left ({ h_{K} a_{i} }right )^{2}+1/rho }}right ) !geq ! T_{j} , quad j=k=K;end{cases}!!!!!!!notag \ {}end{align}is there a specific way where i can convert it with ease from latex to matlab
an example of an equation i want to know how can i write it in matlab form from latex
example 1:
begin{equation} h_{k}=frac {A(m+1)}{2 pi d_{k}^{2}}cos ^{m}(phi _{k})T(psi _{k})g(psi _{k})cos (psi _{k}), end{equation}
example 2:
begin{align} tilde {R}_{k rightarrow j}!=! begin{cases} !! frac {B}{2} log _{2}left ({1 + frac {left ({ h_{k} a_{j} }right )^{2}} {sum _{i=j+1}^{K}left ({ h_{k} a_{i} }right )^{2} + varepsilon sum _{i=1}^{j-1}left ({ h_{k} a_{i} }right )^{2}+ 1/rho } }right ) geq T_{j},\ qquad j leq k,j neq K;\ !! frac {B}{2}log _{2} left ({! 1!+!frac {left ({ h_{K} a_{j} }right )^{2}} {varepsilon sum _{i=1}^{j-1}left ({ h_{K} a_{i} }right )^{2}+1/rho }}right ) !geq ! T_{j} , quad j=k=K;end{cases}!!!!!!!notag \ {}end{align} is there a specific way where i can convert it with ease from latex to matlab
an example of an equation i want to know how can i write it in matlab form from latex
example 1:
begin{equation} h_{k}=frac {A(m+1)}{2 pi d_{k}^{2}}cos ^{m}(phi _{k})T(psi _{k})g(psi _{k})cos (psi _{k}), end{equation}
example 2:
begin{align} tilde {R}_{k rightarrow j}!=! begin{cases} !! frac {B}{2} log _{2}left ({1 + frac {left ({ h_{k} a_{j} }right )^{2}} {sum _{i=j+1}^{K}left ({ h_{k} a_{i} }right )^{2} + varepsilon sum _{i=1}^{j-1}left ({ h_{k} a_{i} }right )^{2}+ 1/rho } }right ) geq T_{j},\ qquad j leq k,j neq K;\ !! frac {B}{2}log _{2} left ({! 1!+!frac {left ({ h_{K} a_{j} }right )^{2}} {varepsilon sum _{i=1}^{j-1}left ({ h_{K} a_{i} }right )^{2}+1/rho }}right ) !geq ! T_{j} , quad j=k=K;end{cases}!!!!!!!notag \ {}end{align} how to, latex, tex, special characters MATLAB Answers — New Questions
How should I assess the training of my agent using PPO and Q-learning?
Urgent !!!!
Hello everybody
I am working on my project to implement a reinforcement learning agent to evaluate the security level of a waf with sql injection.
I started by training two PPO and Q-learning algorithms. I would like you to help me analyze the convergent curve of my models and also if there are parameters to adjust in order to find the right learning rate value.
you will find my code attached and on the image the rewards by episodesUrgent !!!!
Hello everybody
I am working on my project to implement a reinforcement learning agent to evaluate the security level of a waf with sql injection.
I started by training two PPO and Q-learning algorithms. I would like you to help me analyze the convergent curve of my models and also if there are parameters to adjust in order to find the right learning rate value.
you will find my code attached and on the image the rewards by episodes Urgent !!!!
Hello everybody
I am working on my project to implement a reinforcement learning agent to evaluate the security level of a waf with sql injection.
I started by training two PPO and Q-learning algorithms. I would like you to help me analyze the convergent curve of my models and also if there are parameters to adjust in order to find the right learning rate value.
you will find my code attached and on the image the rewards by episodes transferred MATLAB Answers — New Questions
Converting Equation of Two Variables Into Matrix Elements – ERROR: Operator ‘*’ is not supported for operands of type ‘function_handle’.
Hello everyone,
I am trying to output a square matrix that is N x M in size, where N = M. In my case, N = 3. So this is a "3×3" matrix
I have a variable that’s called "Kernel". This variable is calculated as an equation in terms of "z" and "z_prime".
My values in z_prime will vary from L / 2N to (2N-1)*(L/2N) , in steps of "L/N".
My "z" variable will be used as an "integration variable" as seen below.
I am trying to calculate an output called the "Z Matrix" which will integrate the "Kernal" variable across specific ranges.
I attached a .pdf file to clarify my end goal.
See the .pdf file attached:
Z_Matrix_Output.pdf
My Integration Limits for "z" will be going from:
z_start = 0 : L/N : (N-1) * (L/N)
z_end = L/N : L/N : L
As of right now, I’m getting the error:
Operator ‘*’ is not supported for operands of type ‘function_handle’.
This is after I tried using "function handles" in my code.
In my attempt, I have tried to use for loops and created function handles to make it easier to generate this matrix.However, I didn’t end up with a "N X M" matrix, I just ended up with a "1 X N" matrix.
I know that there is a way to use "nested" for loops to generate a square matrix of an "N X M" size. However, I wasn’t quite sure on how to implement that in MATLAB for my case.
I have tried to look through different questions/answers on the Mathworks Forum regarding converting equations of two variables into "matrix elements". However, I wasn’t able to find anything that was relevant to my case.
I attached my MATLAB Code for reference.
See MATLAB .m file attached:
Z_Calculation.mHello everyone,
I am trying to output a square matrix that is N x M in size, where N = M. In my case, N = 3. So this is a "3×3" matrix
I have a variable that’s called "Kernel". This variable is calculated as an equation in terms of "z" and "z_prime".
My values in z_prime will vary from L / 2N to (2N-1)*(L/2N) , in steps of "L/N".
My "z" variable will be used as an "integration variable" as seen below.
I am trying to calculate an output called the "Z Matrix" which will integrate the "Kernal" variable across specific ranges.
I attached a .pdf file to clarify my end goal.
See the .pdf file attached:
Z_Matrix_Output.pdf
My Integration Limits for "z" will be going from:
z_start = 0 : L/N : (N-1) * (L/N)
z_end = L/N : L/N : L
As of right now, I’m getting the error:
Operator ‘*’ is not supported for operands of type ‘function_handle’.
This is after I tried using "function handles" in my code.
In my attempt, I have tried to use for loops and created function handles to make it easier to generate this matrix.However, I didn’t end up with a "N X M" matrix, I just ended up with a "1 X N" matrix.
I know that there is a way to use "nested" for loops to generate a square matrix of an "N X M" size. However, I wasn’t quite sure on how to implement that in MATLAB for my case.
I have tried to look through different questions/answers on the Mathworks Forum regarding converting equations of two variables into "matrix elements". However, I wasn’t able to find anything that was relevant to my case.
I attached my MATLAB Code for reference.
See MATLAB .m file attached:
Z_Calculation.m Hello everyone,
I am trying to output a square matrix that is N x M in size, where N = M. In my case, N = 3. So this is a "3×3" matrix
I have a variable that’s called "Kernel". This variable is calculated as an equation in terms of "z" and "z_prime".
My values in z_prime will vary from L / 2N to (2N-1)*(L/2N) , in steps of "L/N".
My "z" variable will be used as an "integration variable" as seen below.
I am trying to calculate an output called the "Z Matrix" which will integrate the "Kernal" variable across specific ranges.
I attached a .pdf file to clarify my end goal.
See the .pdf file attached:
Z_Matrix_Output.pdf
My Integration Limits for "z" will be going from:
z_start = 0 : L/N : (N-1) * (L/N)
z_end = L/N : L/N : L
As of right now, I’m getting the error:
Operator ‘*’ is not supported for operands of type ‘function_handle’.
This is after I tried using "function handles" in my code.
In my attempt, I have tried to use for loops and created function handles to make it easier to generate this matrix.However, I didn’t end up with a "N X M" matrix, I just ended up with a "1 X N" matrix.
I know that there is a way to use "nested" for loops to generate a square matrix of an "N X M" size. However, I wasn’t quite sure on how to implement that in MATLAB for my case.
I have tried to look through different questions/answers on the Mathworks Forum regarding converting equations of two variables into "matrix elements". However, I wasn’t able to find anything that was relevant to my case.
I attached my MATLAB Code for reference.
See MATLAB .m file attached:
Z_Calculation.m matrix array, matrix, matrix manipulation, integration, numerical integration MATLAB Answers — New Questions
Any ideas for making this exponential decay function match the actual data better?
Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much!Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much! Hi all,
I have been trying to fit some weight data that was collected over time to an exponential decay function. I have come up with the following:
f(t) = An + (A0 – An) * exp (- t / tau)
Where: An = final data point measured, A0 = initial data point measured, and tau = a time constant that I am seeking to fit/solve for.
I am using the following code to set up the decay and solve for tau. Data is the collected weight data and t is the times at which the data was collected:
funlist={@(tau, t) An + (A0 – An) .* exp(-t / tau),1}; % define function
[tau]=fminspleas(funlist,1,time,data); % tau estimate
A0 = data(1);
An = data(end);
fn_data=@(t) funlist{1}(tau,t);
When I go to plot the data points to compare it with the fit, I notice the decay function does not do well at later time points where there is a greater plateau (see attached). I am wondering if anyone has any code or functions suggestions to help improve the fit of the curve? Any suggestions are welcome. Thank you very much! exponential decay, custom cuve fitting MATLAB Answers — New Questions
Issue with Contact analysis in Simscape – solid body contact
Hi,
I am trying to simulate a gear pair contact analysis in Simscape where I import the bodies from stl file. Upon simulation, the gear tooth meshings are not happening correctly and I have severe interference. I tried solving the issue with different solvers, but still the meshing is not appropriate. Could you please suggest how I can solve this issue?
Thanks,
AnandHi,
I am trying to simulate a gear pair contact analysis in Simscape where I import the bodies from stl file. Upon simulation, the gear tooth meshings are not happening correctly and I have severe interference. I tried solving the issue with different solvers, but still the meshing is not appropriate. Could you please suggest how I can solve this issue?
Thanks,
Anand Hi,
I am trying to simulate a gear pair contact analysis in Simscape where I import the bodies from stl file. Upon simulation, the gear tooth meshings are not happening correctly and I have severe interference. I tried solving the issue with different solvers, but still the meshing is not appropriate. Could you please suggest how I can solve this issue?
Thanks,
Anand simscape, contact, gears, contact analysis MATLAB Answers — New Questions
How to fill missing time points from a txt file
I have txt files that I am trying to read in and towards the end of the file it starts skipping time values and data points. I am trying to compare this txt file to another excel data set. I would like to create the missing time variables on the txt file and just fill them with NaN variables that way I can better match up the time. Should I use the fillmissing function? Any suggestion would be appreciated.
The excel file is also time shifted by about 3 seconds late so that is another problem I will have to face.I have txt files that I am trying to read in and towards the end of the file it starts skipping time values and data points. I am trying to compare this txt file to another excel data set. I would like to create the missing time variables on the txt file and just fill them with NaN variables that way I can better match up the time. Should I use the fillmissing function? Any suggestion would be appreciated.
The excel file is also time shifted by about 3 seconds late so that is another problem I will have to face. I have txt files that I am trying to read in and towards the end of the file it starts skipping time values and data points. I am trying to compare this txt file to another excel data set. I would like to create the missing time variables on the txt file and just fill them with NaN variables that way I can better match up the time. Should I use the fillmissing function? Any suggestion would be appreciated.
The excel file is also time shifted by about 3 seconds late so that is another problem I will have to face. fillmissing, readtable, retime, missing data MATLAB Answers — New Questions
How to create a Simscape custom component with 2 different thermal liquids?
Dear all,
I am currently trying to create a custom component block for Simscape Thermal Liquid that models the heat transfer behaviour of a specific heat exchanger between two different thermal liquids. The code creates the block with no errors, nor warnings, and runs fine as long as I do not define thermal properties for both liquids. When I do define thermal properties for both liquids, I get the following error:
I imagine that the error comes from the fact that my code "expects" the 4 nodes (in/out for both liquids) to share properties, but I cannot find where that definition comes from…
Does anyone know how to define nodes that do not share fluid properties?
As a simpler test case, I am trying to make it work with a custom component block based on the Flow Rate Sensor (TL) library block, with 4 ports instead of 2. Same error comes up, but the code is much simpler to work with:
component flow_sensor_two_fluids
nodes
A = foundation.thermal_liquid.thermal_liquid; % A :left
B = foundation.thermal_liquid.thermal_liquid; % B :right
C = foundation.thermal_liquid.thermal_liquid; % C :left
D = foundation.thermal_liquid.thermal_liquid; % D :right
end
outputs
M1 = {0, ‘kg/s’};
M2 = {0, ‘kg/s’};
end
annotations
[M1] : Side=top
[M2] : Side=bottom
end
variables (Access = protected, ExternalAccess = none)
mdot1 = {0, ‘kg/s’}; % Mass flow rate from port A to port B
Phi1 = {0, ‘kW’ }; % Energy flow rate from port A to port B
mdot2 = {0, ‘kg/s’}; % Mass flow rate from port C to port D
Phi2 = {0, ‘kW’ }; % Energy flow rate from port C to port D
end
branches
mdot1 : A.mdot -> B.mdot;
Phi1 : A.Phi -> B.Phi;
mdot2 : C.mdot -> D.mdot;
Phi2 : C.Phi -> D.Phi;
end
equations
M1 == mdot1;
A.p == B.p;
A.T == B.T;
M2 == mdot2;
C.p == D.p;
C.T == D.T;
end
end
Thank you for your help!
PS: (I am aware that there already exists a heat exchanger (TL-TL) block that MathWorks provide, but would prefer to create my own)Dear all,
I am currently trying to create a custom component block for Simscape Thermal Liquid that models the heat transfer behaviour of a specific heat exchanger between two different thermal liquids. The code creates the block with no errors, nor warnings, and runs fine as long as I do not define thermal properties for both liquids. When I do define thermal properties for both liquids, I get the following error:
I imagine that the error comes from the fact that my code "expects" the 4 nodes (in/out for both liquids) to share properties, but I cannot find where that definition comes from…
Does anyone know how to define nodes that do not share fluid properties?
As a simpler test case, I am trying to make it work with a custom component block based on the Flow Rate Sensor (TL) library block, with 4 ports instead of 2. Same error comes up, but the code is much simpler to work with:
component flow_sensor_two_fluids
nodes
A = foundation.thermal_liquid.thermal_liquid; % A :left
B = foundation.thermal_liquid.thermal_liquid; % B :right
C = foundation.thermal_liquid.thermal_liquid; % C :left
D = foundation.thermal_liquid.thermal_liquid; % D :right
end
outputs
M1 = {0, ‘kg/s’};
M2 = {0, ‘kg/s’};
end
annotations
[M1] : Side=top
[M2] : Side=bottom
end
variables (Access = protected, ExternalAccess = none)
mdot1 = {0, ‘kg/s’}; % Mass flow rate from port A to port B
Phi1 = {0, ‘kW’ }; % Energy flow rate from port A to port B
mdot2 = {0, ‘kg/s’}; % Mass flow rate from port C to port D
Phi2 = {0, ‘kW’ }; % Energy flow rate from port C to port D
end
branches
mdot1 : A.mdot -> B.mdot;
Phi1 : A.Phi -> B.Phi;
mdot2 : C.mdot -> D.mdot;
Phi2 : C.Phi -> D.Phi;
end
equations
M1 == mdot1;
A.p == B.p;
A.T == B.T;
M2 == mdot2;
C.p == D.p;
C.T == D.T;
end
end
Thank you for your help!
PS: (I am aware that there already exists a heat exchanger (TL-TL) block that MathWorks provide, but would prefer to create my own) Dear all,
I am currently trying to create a custom component block for Simscape Thermal Liquid that models the heat transfer behaviour of a specific heat exchanger between two different thermal liquids. The code creates the block with no errors, nor warnings, and runs fine as long as I do not define thermal properties for both liquids. When I do define thermal properties for both liquids, I get the following error:
I imagine that the error comes from the fact that my code "expects" the 4 nodes (in/out for both liquids) to share properties, but I cannot find where that definition comes from…
Does anyone know how to define nodes that do not share fluid properties?
As a simpler test case, I am trying to make it work with a custom component block based on the Flow Rate Sensor (TL) library block, with 4 ports instead of 2. Same error comes up, but the code is much simpler to work with:
component flow_sensor_two_fluids
nodes
A = foundation.thermal_liquid.thermal_liquid; % A :left
B = foundation.thermal_liquid.thermal_liquid; % B :right
C = foundation.thermal_liquid.thermal_liquid; % C :left
D = foundation.thermal_liquid.thermal_liquid; % D :right
end
outputs
M1 = {0, ‘kg/s’};
M2 = {0, ‘kg/s’};
end
annotations
[M1] : Side=top
[M2] : Side=bottom
end
variables (Access = protected, ExternalAccess = none)
mdot1 = {0, ‘kg/s’}; % Mass flow rate from port A to port B
Phi1 = {0, ‘kW’ }; % Energy flow rate from port A to port B
mdot2 = {0, ‘kg/s’}; % Mass flow rate from port C to port D
Phi2 = {0, ‘kW’ }; % Energy flow rate from port C to port D
end
branches
mdot1 : A.mdot -> B.mdot;
Phi1 : A.Phi -> B.Phi;
mdot2 : C.mdot -> D.mdot;
Phi2 : C.Phi -> D.Phi;
end
equations
M1 == mdot1;
A.p == B.p;
A.T == B.T;
M2 == mdot2;
C.p == D.p;
C.T == D.T;
end
end
Thank you for your help!
PS: (I am aware that there already exists a heat exchanger (TL-TL) block that MathWorks provide, but would prefer to create my own) simscape, custom components, themal liquid MATLAB Answers — New Questions
How can i use ansys_aas to interface between matlab and ansys workbench ?
How can i use ansys_aas to interface between matlab and ansys workbench ?How can i use ansys_aas to interface between matlab and ansys workbench ? How can i use ansys_aas to interface between matlab and ansys workbench ? ansys, matlab MATLAB Answers — New Questions
I want to make curve fitting to these points
I want to make curve fitting to these points but when i made it the blue straight line appeared. What does it mean ?I want to make curve fitting to these points but when i made it the blue straight line appeared. What does it mean ? I want to make curve fitting to these points but when i made it the blue straight line appeared. What does it mean ? matlab, curve fitting MATLAB Answers — New Questions
It is a coding function net1.net to detect images
clc;clear;close all;
image_folder = ‘daftar uang’;
filenames = dir(fullfile(image_folder, ‘*.jpg’));
total_images = numel(filenames);
for n = 1:total_images
full_name= fullfile(image_folder, filenames(n).name);
I = imread(full_name);
J = I(:,:,1);
K = imbinarize(J,.6);
L = imcomplement(K);
str = strel(‘disk’,5);
M = imclose(L,str);
N = imfill(M,’holes’);
O = bwareaopen(N,1000);
stats = regionprops(O,’Area’,’Perimeter’,’Eccentricity’);
area(n) = stats.Area;
perimeter(n) = stats.Perimeter;
metric(n) = 4*pi*area(n)/(perimeter(n)^2);
eccentricity(n) = stats.Eccentricity;
end
input = [metric;eccentricity];
target = zeros(1,48);
target(:,1:12) = 1;
target(:,13:24) = 2;
target(:,25:36) = 3;
target(:,37:48) = 4;
net = newff(input,target,[10 5],{‘logsig’,’logsig’},’trainlm’);
net.trainParam.epochs = 1000;
net.trainParam.goal = 1e-6;
net = train(net,input,target);
output = round(sim(net,input));
save net1.mat net
[m,n] = find(output==target);
akurasi = sum(m)/total_images*100
"Why is the accuracy I get only 25%? help me please?"clc;clear;close all;
image_folder = ‘daftar uang’;
filenames = dir(fullfile(image_folder, ‘*.jpg’));
total_images = numel(filenames);
for n = 1:total_images
full_name= fullfile(image_folder, filenames(n).name);
I = imread(full_name);
J = I(:,:,1);
K = imbinarize(J,.6);
L = imcomplement(K);
str = strel(‘disk’,5);
M = imclose(L,str);
N = imfill(M,’holes’);
O = bwareaopen(N,1000);
stats = regionprops(O,’Area’,’Perimeter’,’Eccentricity’);
area(n) = stats.Area;
perimeter(n) = stats.Perimeter;
metric(n) = 4*pi*area(n)/(perimeter(n)^2);
eccentricity(n) = stats.Eccentricity;
end
input = [metric;eccentricity];
target = zeros(1,48);
target(:,1:12) = 1;
target(:,13:24) = 2;
target(:,25:36) = 3;
target(:,37:48) = 4;
net = newff(input,target,[10 5],{‘logsig’,’logsig’},’trainlm’);
net.trainParam.epochs = 1000;
net.trainParam.goal = 1e-6;
net = train(net,input,target);
output = round(sim(net,input));
save net1.mat net
[m,n] = find(output==target);
akurasi = sum(m)/total_images*100
"Why is the accuracy I get only 25%? help me please?" clc;clear;close all;
image_folder = ‘daftar uang’;
filenames = dir(fullfile(image_folder, ‘*.jpg’));
total_images = numel(filenames);
for n = 1:total_images
full_name= fullfile(image_folder, filenames(n).name);
I = imread(full_name);
J = I(:,:,1);
K = imbinarize(J,.6);
L = imcomplement(K);
str = strel(‘disk’,5);
M = imclose(L,str);
N = imfill(M,’holes’);
O = bwareaopen(N,1000);
stats = regionprops(O,’Area’,’Perimeter’,’Eccentricity’);
area(n) = stats.Area;
perimeter(n) = stats.Perimeter;
metric(n) = 4*pi*area(n)/(perimeter(n)^2);
eccentricity(n) = stats.Eccentricity;
end
input = [metric;eccentricity];
target = zeros(1,48);
target(:,1:12) = 1;
target(:,13:24) = 2;
target(:,25:36) = 3;
target(:,37:48) = 4;
net = newff(input,target,[10 5],{‘logsig’,’logsig’},’trainlm’);
net.trainParam.epochs = 1000;
net.trainParam.goal = 1e-6;
net = train(net,input,target);
output = round(sim(net,input));
save net1.mat net
[m,n] = find(output==target);
akurasi = sum(m)/total_images*100
"Why is the accuracy I get only 25%? help me please?" transferred MATLAB Answers — New Questions
Matlab R2023a traps: MATLABWindow[3569572] general protection fault ip:7f76175fabba sp:7ffe77621cf0 error:0 in libgtk-x11-2.0.so.0.2400.31[7f7617419000+260000]
Hello,
We have Matlab R2023a installed on Oracle Linux8. Below is the message user gets. He reports that he would get a pop up Window that says "Oops Were sorry, it looks like a problem occurred." He says that when this happens matlab doesn’t crash, it marks the beginning of the GUI glitches. MatLab turns all white, And I get a ldd error in the console that spawned matlab, it was related to loading/drawing from what he remembers
We had MATE desktop and that was not working, it was worse with glitches according to the user.
id 6f789c523fa312a7f9199f39a72694e68987d191
reason: traps: MATLABWindow[3569572] general protection fault ip:7f76175fabba sp:7ffe77621cf0 error:0 in libgtk-x11-2.0.so.0.2400.31[7f7617419000+260000]
Can anyone tell me if they have seen this or can assist on how to resolve?
thanks,
DennisHello,
We have Matlab R2023a installed on Oracle Linux8. Below is the message user gets. He reports that he would get a pop up Window that says "Oops Were sorry, it looks like a problem occurred." He says that when this happens matlab doesn’t crash, it marks the beginning of the GUI glitches. MatLab turns all white, And I get a ldd error in the console that spawned matlab, it was related to loading/drawing from what he remembers
We had MATE desktop and that was not working, it was worse with glitches according to the user.
id 6f789c523fa312a7f9199f39a72694e68987d191
reason: traps: MATLABWindow[3569572] general protection fault ip:7f76175fabba sp:7ffe77621cf0 error:0 in libgtk-x11-2.0.so.0.2400.31[7f7617419000+260000]
Can anyone tell me if they have seen this or can assist on how to resolve?
thanks,
Dennis Hello,
We have Matlab R2023a installed on Oracle Linux8. Below is the message user gets. He reports that he would get a pop up Window that says "Oops Were sorry, it looks like a problem occurred." He says that when this happens matlab doesn’t crash, it marks the beginning of the GUI glitches. MatLab turns all white, And I get a ldd error in the console that spawned matlab, it was related to loading/drawing from what he remembers
We had MATE desktop and that was not working, it was worse with glitches according to the user.
id 6f789c523fa312a7f9199f39a72694e68987d191
reason: traps: MATLABWindow[3569572] general protection fault ip:7f76175fabba sp:7ffe77621cf0 error:0 in libgtk-x11-2.0.so.0.2400.31[7f7617419000+260000]
Can anyone tell me if they have seen this or can assist on how to resolve?
thanks,
Dennis general protection fault, ibgtk-x11-2.0.so.0.2400.31 MATLAB Answers — New Questions
how to do rising and falling edge in single signal using signal builder..?
Post Content Post Content simulink MATLAB Answers — New Questions
The Mathieu Equation—Stability for 2DOF whirlflutter system
I am attempting to create a whirl flutter diagram based on these calculations by identifying regions of instability such as flutter and divergence areas by examining the eigenvalues of the system. As my coefficients are periodic
Is my approach for determining the Stiffnesses and angles correct, and how can I change the process using the Floquet technique and the Mathieu equation? Because ultimately, the boundries are not shown correctly according to the reference.
clc;
clear all;
% Define parameters
N = 2; % Number of blades
I_thetaoverI_b = 2; % Moment of inertia pitch axis over I_b
I_psioverI_b = 2; % Moment of inertia yaw axis over I_b
C_thetaoverI_b = 0.00; % Damping coefficient over I_b
C_psioverI_b = 0.00; % Damping coefficient over I_b
h = 0.3; % rotor mast height, wing tip spar to rotor hub
hoverR = 0.34;
R = h / hoverR;
gamma = 4; % lock number
V = 1000; % the rotor forward velocity [knots]
Omega = V/R; % the rotor rotational speed [RPM]
freq_1_over_Omega = 1 / Omega;
%the flap moment aerodynamic coefficients for large V
M_b = -(1/10)*V;
M_u = 1/6;
%the propeller aerodynamic coefficients
H_u = V/2;
% Frequency ranges
f_pitch= 0.001:0.5:5;
f_yaw= 0.001:0.5:5;
% Time periods for pitch and yaw
T_pitch = 1 ./ (2 * pi * f_pitch);
T_yaw = 1 ./ (2 * pi * f_yaw);
divergence_map = [];
Rdivergence_map = [];
unstable = [];
% Modify the loop to iterate over time points
for i = 1:length(T_pitch)
for j = 1:length(T_yaw)
T = max(T_pitch(i), T_yaw(j)); % Use the maximum period to cover all dynamics
t_steps = linspace(0, T, 100); % Time steps within one period
for t = t_steps
% Angular frequencies for the current time point
w_omega_pitch = 2 * pi / T_pitch(i);
w_omega_yaw = 2 * pi / T_yaw(j);
K_psi = (w_omega_pitch^2) * I_psioverI_b;
K_theta = (w_omega_yaw^2) * I_thetaoverI_b;
% Calculate matrices at time t using harmonic motion expressions
phi = 2 * pi * t / T; % Phase variation over the period
% Define inertia matrix [M]
M_matrix = [I_thetaoverI_b + 1 + cos(2*phi), -sin(2*phi);
-sin(2*phi), I_psioverI_b + 1 – cos(2*phi)];
% Define damping matrix [D]
D11 = h^2*gamma*H_u*(1 – cos(2*phi)) – gamma*M_b*(1 + cos(2*phi)) – (2 + 2*h*gamma*M_u)*sin(2*phi);
D12 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) – 2*(1 + cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D21 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) + 2*(1 – cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D22 = h^2*gamma*H_u*(1 + cos(2*phi)) – gamma*M_b*(1 – cos(2*phi)) + (2 + 2*h*gamma*M_u)*sin(2*phi);
D_matrix = [D11, D12;
D21, D22];
% Define stiffness matrix [K]
K11 = K_theta – h*gamma*V*H_u*(1 – cos(2*phi)) + gamma*V*M_u*sin(2*phi);
K12 = -h*V*gamma*H_u*sin(2*phi) + gamma*V*M_u*(1 + cos(2*phi));
K21 = -h*gamma*V*H_u*sin(2*phi) – gamma*V*M_u*(1 – cos(2*phi));
K22 = K_psi – h*gamma*V*H_u*(1 + cos(2*phi)) – gamma*V*M_u*sin(2*phi);
K_matrix = [K11, K12;
K21, K22];
% Compute the system matrices
M11 = M_matrix(1, 1); M12 = M_matrix(1, 2); M21 = M_matrix(2, 1); M22 = M_matrix(2, 2);
D11 = D_matrix(1, 1); D12 = D_matrix(1, 2); D21 = D_matrix(2, 1); D22 = D_matrix(2, 2);
K11 = K_matrix(1, 1); K12 = K_matrix(1, 2); K21 = K_matrix(2, 1); K22 = K_matrix(2, 2);
P0 = M11*M22-M12*M21;
P1 = (- D11*M22*1j – D22*M11*1j + M12*D21*j + D12*M21*j);
P2 = (D11*D22*(1j)^2 – K22*M11 – K11*M22 – D12*D21*(1j)^2 + M12*K21 + M21*K12);
P3 = (D11*K22*1j – D12*K21*1j – D21*K12*1j + D22*K11*1j);
P4 = K11*K22 – K12*K21;
P = roots([P0, P1, P2, P3, P4]);
r = 1 * P;
%Flutter
for k = 1:length(r)
if (real(r(k)) > 0)
if (imag(r(k)) <= 0)
unstable = [unstable; phi, K_psi, K_theta];
% Proximity check for 1/Ω divergence
if abs(real(r(k)) – freq_1_over_Omega) < 1e-5
Rdivergence_map = [Rdivergence_map; phi, K_psi, K_theta];
end
end
end
end
%Divergence
if (real(det(K_matrix)) < 0)
divergence_map = [divergence_map; t, K_psi, K_theta];
end
end
end
end
% Plotting section
figure;
hold on;
scatter(unstable(:,2), unstable(:,3), ‘filled’);
scatter(divergence_map(:,2), divergence_map(:,3), ‘filled’, ‘r’);
scatter(Rdivergence_map(:,2), Rdivergence_map(:,3), ‘filled’, ‘g’);
xlabel(‘K_psi’);
ylabel(‘K_theta’);
title(‘Whirl Flutter Diagram’);
legend(‘Flutter area’, ‘Divergence area’, ‘1/Ω Divergence area’);
hold off;I am attempting to create a whirl flutter diagram based on these calculations by identifying regions of instability such as flutter and divergence areas by examining the eigenvalues of the system. As my coefficients are periodic
Is my approach for determining the Stiffnesses and angles correct, and how can I change the process using the Floquet technique and the Mathieu equation? Because ultimately, the boundries are not shown correctly according to the reference.
clc;
clear all;
% Define parameters
N = 2; % Number of blades
I_thetaoverI_b = 2; % Moment of inertia pitch axis over I_b
I_psioverI_b = 2; % Moment of inertia yaw axis over I_b
C_thetaoverI_b = 0.00; % Damping coefficient over I_b
C_psioverI_b = 0.00; % Damping coefficient over I_b
h = 0.3; % rotor mast height, wing tip spar to rotor hub
hoverR = 0.34;
R = h / hoverR;
gamma = 4; % lock number
V = 1000; % the rotor forward velocity [knots]
Omega = V/R; % the rotor rotational speed [RPM]
freq_1_over_Omega = 1 / Omega;
%the flap moment aerodynamic coefficients for large V
M_b = -(1/10)*V;
M_u = 1/6;
%the propeller aerodynamic coefficients
H_u = V/2;
% Frequency ranges
f_pitch= 0.001:0.5:5;
f_yaw= 0.001:0.5:5;
% Time periods for pitch and yaw
T_pitch = 1 ./ (2 * pi * f_pitch);
T_yaw = 1 ./ (2 * pi * f_yaw);
divergence_map = [];
Rdivergence_map = [];
unstable = [];
% Modify the loop to iterate over time points
for i = 1:length(T_pitch)
for j = 1:length(T_yaw)
T = max(T_pitch(i), T_yaw(j)); % Use the maximum period to cover all dynamics
t_steps = linspace(0, T, 100); % Time steps within one period
for t = t_steps
% Angular frequencies for the current time point
w_omega_pitch = 2 * pi / T_pitch(i);
w_omega_yaw = 2 * pi / T_yaw(j);
K_psi = (w_omega_pitch^2) * I_psioverI_b;
K_theta = (w_omega_yaw^2) * I_thetaoverI_b;
% Calculate matrices at time t using harmonic motion expressions
phi = 2 * pi * t / T; % Phase variation over the period
% Define inertia matrix [M]
M_matrix = [I_thetaoverI_b + 1 + cos(2*phi), -sin(2*phi);
-sin(2*phi), I_psioverI_b + 1 – cos(2*phi)];
% Define damping matrix [D]
D11 = h^2*gamma*H_u*(1 – cos(2*phi)) – gamma*M_b*(1 + cos(2*phi)) – (2 + 2*h*gamma*M_u)*sin(2*phi);
D12 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) – 2*(1 + cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D21 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) + 2*(1 – cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D22 = h^2*gamma*H_u*(1 + cos(2*phi)) – gamma*M_b*(1 – cos(2*phi)) + (2 + 2*h*gamma*M_u)*sin(2*phi);
D_matrix = [D11, D12;
D21, D22];
% Define stiffness matrix [K]
K11 = K_theta – h*gamma*V*H_u*(1 – cos(2*phi)) + gamma*V*M_u*sin(2*phi);
K12 = -h*V*gamma*H_u*sin(2*phi) + gamma*V*M_u*(1 + cos(2*phi));
K21 = -h*gamma*V*H_u*sin(2*phi) – gamma*V*M_u*(1 – cos(2*phi));
K22 = K_psi – h*gamma*V*H_u*(1 + cos(2*phi)) – gamma*V*M_u*sin(2*phi);
K_matrix = [K11, K12;
K21, K22];
% Compute the system matrices
M11 = M_matrix(1, 1); M12 = M_matrix(1, 2); M21 = M_matrix(2, 1); M22 = M_matrix(2, 2);
D11 = D_matrix(1, 1); D12 = D_matrix(1, 2); D21 = D_matrix(2, 1); D22 = D_matrix(2, 2);
K11 = K_matrix(1, 1); K12 = K_matrix(1, 2); K21 = K_matrix(2, 1); K22 = K_matrix(2, 2);
P0 = M11*M22-M12*M21;
P1 = (- D11*M22*1j – D22*M11*1j + M12*D21*j + D12*M21*j);
P2 = (D11*D22*(1j)^2 – K22*M11 – K11*M22 – D12*D21*(1j)^2 + M12*K21 + M21*K12);
P3 = (D11*K22*1j – D12*K21*1j – D21*K12*1j + D22*K11*1j);
P4 = K11*K22 – K12*K21;
P = roots([P0, P1, P2, P3, P4]);
r = 1 * P;
%Flutter
for k = 1:length(r)
if (real(r(k)) > 0)
if (imag(r(k)) <= 0)
unstable = [unstable; phi, K_psi, K_theta];
% Proximity check for 1/Ω divergence
if abs(real(r(k)) – freq_1_over_Omega) < 1e-5
Rdivergence_map = [Rdivergence_map; phi, K_psi, K_theta];
end
end
end
end
%Divergence
if (real(det(K_matrix)) < 0)
divergence_map = [divergence_map; t, K_psi, K_theta];
end
end
end
end
% Plotting section
figure;
hold on;
scatter(unstable(:,2), unstable(:,3), ‘filled’);
scatter(divergence_map(:,2), divergence_map(:,3), ‘filled’, ‘r’);
scatter(Rdivergence_map(:,2), Rdivergence_map(:,3), ‘filled’, ‘g’);
xlabel(‘K_psi’);
ylabel(‘K_theta’);
title(‘Whirl Flutter Diagram’);
legend(‘Flutter area’, ‘Divergence area’, ‘1/Ω Divergence area’);
hold off; I am attempting to create a whirl flutter diagram based on these calculations by identifying regions of instability such as flutter and divergence areas by examining the eigenvalues of the system. As my coefficients are periodic
Is my approach for determining the Stiffnesses and angles correct, and how can I change the process using the Floquet technique and the Mathieu equation? Because ultimately, the boundries are not shown correctly according to the reference.
clc;
clear all;
% Define parameters
N = 2; % Number of blades
I_thetaoverI_b = 2; % Moment of inertia pitch axis over I_b
I_psioverI_b = 2; % Moment of inertia yaw axis over I_b
C_thetaoverI_b = 0.00; % Damping coefficient over I_b
C_psioverI_b = 0.00; % Damping coefficient over I_b
h = 0.3; % rotor mast height, wing tip spar to rotor hub
hoverR = 0.34;
R = h / hoverR;
gamma = 4; % lock number
V = 1000; % the rotor forward velocity [knots]
Omega = V/R; % the rotor rotational speed [RPM]
freq_1_over_Omega = 1 / Omega;
%the flap moment aerodynamic coefficients for large V
M_b = -(1/10)*V;
M_u = 1/6;
%the propeller aerodynamic coefficients
H_u = V/2;
% Frequency ranges
f_pitch= 0.001:0.5:5;
f_yaw= 0.001:0.5:5;
% Time periods for pitch and yaw
T_pitch = 1 ./ (2 * pi * f_pitch);
T_yaw = 1 ./ (2 * pi * f_yaw);
divergence_map = [];
Rdivergence_map = [];
unstable = [];
% Modify the loop to iterate over time points
for i = 1:length(T_pitch)
for j = 1:length(T_yaw)
T = max(T_pitch(i), T_yaw(j)); % Use the maximum period to cover all dynamics
t_steps = linspace(0, T, 100); % Time steps within one period
for t = t_steps
% Angular frequencies for the current time point
w_omega_pitch = 2 * pi / T_pitch(i);
w_omega_yaw = 2 * pi / T_yaw(j);
K_psi = (w_omega_pitch^2) * I_psioverI_b;
K_theta = (w_omega_yaw^2) * I_thetaoverI_b;
% Calculate matrices at time t using harmonic motion expressions
phi = 2 * pi * t / T; % Phase variation over the period
% Define inertia matrix [M]
M_matrix = [I_thetaoverI_b + 1 + cos(2*phi), -sin(2*phi);
-sin(2*phi), I_psioverI_b + 1 – cos(2*phi)];
% Define damping matrix [D]
D11 = h^2*gamma*H_u*(1 – cos(2*phi)) – gamma*M_b*(1 + cos(2*phi)) – (2 + 2*h*gamma*M_u)*sin(2*phi);
D12 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) – 2*(1 + cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D21 = h^2*gamma*H_u*sin(2*phi) + gamma*M_b*sin(2*phi) + 2*(1 – cos(2*phi)) – 2*h*gamma*M_u*cos(2*phi);
D22 = h^2*gamma*H_u*(1 + cos(2*phi)) – gamma*M_b*(1 – cos(2*phi)) + (2 + 2*h*gamma*M_u)*sin(2*phi);
D_matrix = [D11, D12;
D21, D22];
% Define stiffness matrix [K]
K11 = K_theta – h*gamma*V*H_u*(1 – cos(2*phi)) + gamma*V*M_u*sin(2*phi);
K12 = -h*V*gamma*H_u*sin(2*phi) + gamma*V*M_u*(1 + cos(2*phi));
K21 = -h*gamma*V*H_u*sin(2*phi) – gamma*V*M_u*(1 – cos(2*phi));
K22 = K_psi – h*gamma*V*H_u*(1 + cos(2*phi)) – gamma*V*M_u*sin(2*phi);
K_matrix = [K11, K12;
K21, K22];
% Compute the system matrices
M11 = M_matrix(1, 1); M12 = M_matrix(1, 2); M21 = M_matrix(2, 1); M22 = M_matrix(2, 2);
D11 = D_matrix(1, 1); D12 = D_matrix(1, 2); D21 = D_matrix(2, 1); D22 = D_matrix(2, 2);
K11 = K_matrix(1, 1); K12 = K_matrix(1, 2); K21 = K_matrix(2, 1); K22 = K_matrix(2, 2);
P0 = M11*M22-M12*M21;
P1 = (- D11*M22*1j – D22*M11*1j + M12*D21*j + D12*M21*j);
P2 = (D11*D22*(1j)^2 – K22*M11 – K11*M22 – D12*D21*(1j)^2 + M12*K21 + M21*K12);
P3 = (D11*K22*1j – D12*K21*1j – D21*K12*1j + D22*K11*1j);
P4 = K11*K22 – K12*K21;
P = roots([P0, P1, P2, P3, P4]);
r = 1 * P;
%Flutter
for k = 1:length(r)
if (real(r(k)) > 0)
if (imag(r(k)) <= 0)
unstable = [unstable; phi, K_psi, K_theta];
% Proximity check for 1/Ω divergence
if abs(real(r(k)) – freq_1_over_Omega) < 1e-5
Rdivergence_map = [Rdivergence_map; phi, K_psi, K_theta];
end
end
end
end
%Divergence
if (real(det(K_matrix)) < 0)
divergence_map = [divergence_map; t, K_psi, K_theta];
end
end
end
end
% Plotting section
figure;
hold on;
scatter(unstable(:,2), unstable(:,3), ‘filled’);
scatter(divergence_map(:,2), divergence_map(:,3), ‘filled’, ‘r’);
scatter(Rdivergence_map(:,2), Rdivergence_map(:,3), ‘filled’, ‘g’);
xlabel(‘K_psi’);
ylabel(‘K_theta’);
title(‘Whirl Flutter Diagram’);
legend(‘Flutter area’, ‘Divergence area’, ‘1/Ω Divergence area’);
hold off; floquet technic, dynamical system MATLAB Answers — New Questions
why we want to use matlab for fingerprint enhancement Is it the best software for fingerprint enhancement?
As I am using Matlab for fingerprint enhancement. I got some doubt why we can use Matlab only why we cannot use other software and In what way Matlab is best in fingerprint enhancementAs I am using Matlab for fingerprint enhancement. I got some doubt why we can use Matlab only why we cannot use other software and In what way Matlab is best in fingerprint enhancement As I am using Matlab for fingerprint enhancement. I got some doubt why we can use Matlab only why we cannot use other software and In what way Matlab is best in fingerprint enhancement matlab fingerprint, image processing MATLAB Answers — New Questions
how do i get the sigmas out of the livescript display?
Hi Everyone,
I am currently working with a very long equation. And when I output it in the livescript, MATLAB finds several sigmas (see screenshot). I would like to have this equation with the sigmas in order to process it in another function.
So far I have tried [r,sigma] = subexpr(expr). I cancelled this command after more than 1 hour of calculation. In addition, subexpr, if I have understood it correctly, only looks for one sigma.
I hope someone here can help me.
I am working with Matla 2017b and the symbolic toolboxHi Everyone,
I am currently working with a very long equation. And when I output it in the livescript, MATLAB finds several sigmas (see screenshot). I would like to have this equation with the sigmas in order to process it in another function.
So far I have tried [r,sigma] = subexpr(expr). I cancelled this command after more than 1 hour of calculation. In addition, subexpr, if I have understood it correctly, only looks for one sigma.
I hope someone here can help me.
I am working with Matla 2017b and the symbolic toolbox Hi Everyone,
I am currently working with a very long equation. And when I output it in the livescript, MATLAB finds several sigmas (see screenshot). I would like to have this equation with the sigmas in order to process it in another function.
So far I have tried [r,sigma] = subexpr(expr). I cancelled this command after more than 1 hour of calculation. In addition, subexpr, if I have understood it correctly, only looks for one sigma.
I hope someone here can help me.
I am working with Matla 2017b and the symbolic toolbox subexpr, matlab, simplify MATLAB Answers — New Questions
uiwait(msgbox(“My message”) dialog comes up behind the app. User never sees it.
Why does uiwait(msgbox("My message") dialog come up behind the app? My user never sees it so can’t click OK. Is there a way to bring it to the front other than uialert() which is a lot more complex to program?Why does uiwait(msgbox("My message") dialog come up behind the app? My user never sees it so can’t click OK. Is there a way to bring it to the front other than uialert() which is a lot more complex to program? Why does uiwait(msgbox("My message") dialog come up behind the app? My user never sees it so can’t click OK. Is there a way to bring it to the front other than uialert() which is a lot more complex to program? uiwait, bring to front MATLAB Answers — New Questions
heat transfer between the air in the cavity and the surrounding solid layers
I am working on simulating heat transfer in a component that consists of multiple solid layers and an enclosed air cavity using the PDE Toolbox in MATLAB. My goal is to account for heat transfer mechanisms such as radiation and convection between the air in the cavity and the surrounding solid layers. is this possible with the pde toolbox? Is there a solutuion without modelling the air as a solid material?I am working on simulating heat transfer in a component that consists of multiple solid layers and an enclosed air cavity using the PDE Toolbox in MATLAB. My goal is to account for heat transfer mechanisms such as radiation and convection between the air in the cavity and the surrounding solid layers. is this possible with the pde toolbox? Is there a solutuion without modelling the air as a solid material? I am working on simulating heat transfer in a component that consists of multiple solid layers and an enclosed air cavity using the PDE Toolbox in MATLAB. My goal is to account for heat transfer mechanisms such as radiation and convection between the air in the cavity and the surrounding solid layers. is this possible with the pde toolbox? Is there a solutuion without modelling the air as a solid material? heat transfer, air cavity, pde MATLAB Answers — New Questions
Please help me understand output from discretize
I am trying to understand what discretize is doing, I have data ranging from 0 to 1 and want to bin it in bins of size .01.
X=[.01:.01:1] ; % – example data uniformly going form .01 to 1 in steps of .01
binEdges=[0:0.01:1]; %- the bind edges
binLocs=discretize(X,binEdges,’IncludedEdge’,’right’); %
%I would expect each bin gets 1 value so that bon locs is [1 2 3 4 5 6 7 8 9 10 etc… up to 100]
but what I get is binLocs=
1 2 3 4 5 7 7 8 9 10 11 12 13 14 16 16 17 19 19 20 22 22 23 25 25 26 27 28 30 30 31 32 33 34 35 37 37 38 39 40 41 43 43 44 45 46 47 49 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
why is is repeating some (for example the values .06 and .07 go in bin 7 and nothing in bin 6 ?
I’d like the first bin to b 0<=x<=.01 bin 2 .01<x<=.02 bin 3 .02<x<=.03 etc..
can someone explain why I am getting 2 values in some bins ( i.e. bin 7 and bin 22)
Thanks,
-JeffI am trying to understand what discretize is doing, I have data ranging from 0 to 1 and want to bin it in bins of size .01.
X=[.01:.01:1] ; % – example data uniformly going form .01 to 1 in steps of .01
binEdges=[0:0.01:1]; %- the bind edges
binLocs=discretize(X,binEdges,’IncludedEdge’,’right’); %
%I would expect each bin gets 1 value so that bon locs is [1 2 3 4 5 6 7 8 9 10 etc… up to 100]
but what I get is binLocs=
1 2 3 4 5 7 7 8 9 10 11 12 13 14 16 16 17 19 19 20 22 22 23 25 25 26 27 28 30 30 31 32 33 34 35 37 37 38 39 40 41 43 43 44 45 46 47 49 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
why is is repeating some (for example the values .06 and .07 go in bin 7 and nothing in bin 6 ?
I’d like the first bin to b 0<=x<=.01 bin 2 .01<x<=.02 bin 3 .02<x<=.03 etc..
can someone explain why I am getting 2 values in some bins ( i.e. bin 7 and bin 22)
Thanks,
-Jeff I am trying to understand what discretize is doing, I have data ranging from 0 to 1 and want to bin it in bins of size .01.
X=[.01:.01:1] ; % – example data uniformly going form .01 to 1 in steps of .01
binEdges=[0:0.01:1]; %- the bind edges
binLocs=discretize(X,binEdges,’IncludedEdge’,’right’); %
%I would expect each bin gets 1 value so that bon locs is [1 2 3 4 5 6 7 8 9 10 etc… up to 100]
but what I get is binLocs=
1 2 3 4 5 7 7 8 9 10 11 12 13 14 16 16 17 19 19 20 22 22 23 25 25 26 27 28 30 30 31 32 33 34 35 37 37 38 39 40 41 43 43 44 45 46 47 49 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
why is is repeating some (for example the values .06 and .07 go in bin 7 and nothing in bin 6 ?
I’d like the first bin to b 0<=x<=.01 bin 2 .01<x<=.02 bin 3 .02<x<=.03 etc..
can someone explain why I am getting 2 values in some bins ( i.e. bin 7 and bin 22)
Thanks,
-Jeff discretize, binning MATLAB Answers — New Questions
Matlab running minimised using task scheduler influences image plots
Hi, I have been running a matlab script on a daily basis using windows task scheduler for the past few weeks and have noticed that the output image plots appear compressed (the arrows and contours are squished together, implying some sort of scale issue(?)) when compared with running the same script with matlab already running on my desktop. My script does specify the dimensions of the figure, but these seem to be ignored. Is there a way to correct for this? Related, if I can resolve the former issues, is there a way to force Task Scheduler to run matlab so that it is maximised (not behind the scene).
I’m using the following in Task scheduler to initiate my script:
matlab -r "cd(‘C:MatlabScripts’); run scriptname.m; pause(10)"
Thank you for any thoughts on this,
JonHi, I have been running a matlab script on a daily basis using windows task scheduler for the past few weeks and have noticed that the output image plots appear compressed (the arrows and contours are squished together, implying some sort of scale issue(?)) when compared with running the same script with matlab already running on my desktop. My script does specify the dimensions of the figure, but these seem to be ignored. Is there a way to correct for this? Related, if I can resolve the former issues, is there a way to force Task Scheduler to run matlab so that it is maximised (not behind the scene).
I’m using the following in Task scheduler to initiate my script:
matlab -r "cd(‘C:MatlabScripts’); run scriptname.m; pause(10)"
Thank you for any thoughts on this,
Jon Hi, I have been running a matlab script on a daily basis using windows task scheduler for the past few weeks and have noticed that the output image plots appear compressed (the arrows and contours are squished together, implying some sort of scale issue(?)) when compared with running the same script with matlab already running on my desktop. My script does specify the dimensions of the figure, but these seem to be ignored. Is there a way to correct for this? Related, if I can resolve the former issues, is there a way to force Task Scheduler to run matlab so that it is maximised (not behind the scene).
I’m using the following in Task scheduler to initiate my script:
matlab -r "cd(‘C:MatlabScripts’); run scriptname.m; pause(10)"
Thank you for any thoughts on this,
Jon automatically run script problem with plots MATLAB Answers — New Questions