Tag Archives: matlab
Senstivity analysis in GA
Hello,
Im working to minimise the total cost incurred to retailer by finding optimum value of maximum inventory level using Genetic algorithm. Im considering 4 subcosts (procurment, holding, expiry, lost sales) which have fixed rate (per unit qty). I have to do this over a time period (x days). Ive already done it over different time duration (1 month, and 3 yr). Each day in this time period has pre-determined demand (ie. units sold), taken from CSVDemand file.
How to conduct "senstivity analysis"? I tried searching and understood that i should record changes in result based on the changes in GA parameters. However, on varying the mutation function, selection function, mutation rate, population size, etc im getting the same results. No variation. Is that because of only 1 optimisation variable?
How should i do senstivity analysis then?
Ive attached the code below. TCFunc is the Objective function. GA_1 is the GA code. it was made with help of optimtask insert.
please provide some guidance.Hello,
Im working to minimise the total cost incurred to retailer by finding optimum value of maximum inventory level using Genetic algorithm. Im considering 4 subcosts (procurment, holding, expiry, lost sales) which have fixed rate (per unit qty). I have to do this over a time period (x days). Ive already done it over different time duration (1 month, and 3 yr). Each day in this time period has pre-determined demand (ie. units sold), taken from CSVDemand file.
How to conduct "senstivity analysis"? I tried searching and understood that i should record changes in result based on the changes in GA parameters. However, on varying the mutation function, selection function, mutation rate, population size, etc im getting the same results. No variation. Is that because of only 1 optimisation variable?
How should i do senstivity analysis then?
Ive attached the code below. TCFunc is the Objective function. GA_1 is the GA code. it was made with help of optimtask insert.
please provide some guidance. Hello,
Im working to minimise the total cost incurred to retailer by finding optimum value of maximum inventory level using Genetic algorithm. Im considering 4 subcosts (procurment, holding, expiry, lost sales) which have fixed rate (per unit qty). I have to do this over a time period (x days). Ive already done it over different time duration (1 month, and 3 yr). Each day in this time period has pre-determined demand (ie. units sold), taken from CSVDemand file.
How to conduct "senstivity analysis"? I tried searching and understood that i should record changes in result based on the changes in GA parameters. However, on varying the mutation function, selection function, mutation rate, population size, etc im getting the same results. No variation. Is that because of only 1 optimisation variable?
How should i do senstivity analysis then?
Ive attached the code below. TCFunc is the Objective function. GA_1 is the GA code. it was made with help of optimtask insert.
please provide some guidance. senstivity analysis, genetic algorithm, optimization MATLAB Answers — New Questions
I have error in FDM 2
function FDMex()
N = 100;
h = 0.1;
eta = 0:h:N;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for j = 1:N+1
if (abs(H(j)-H1(j))>Ac); (abs(F(j)-F1(j))>Ac);(abs(G(j)-G1(j))>Ac);(abs(theta(1)-theta1(1))>Ac);(abs(phi(j)-phi1(j))>Ac);
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:0.1:N;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h)
for i = 1:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F(i)*((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = (G(i) + G(i+2))/2 -(h/2)*H(i)*(G(i+1)-G(i)) – (h^2)*F(i)*G(i) + (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i))/h)+G(i)) – (h^2)*k*(F(i)*((G(i) -2*G(i+1) + G(i+2))/h^2) – ((F(i+1)-F(i))/h)*((G(i+1)-G(i))/h));
theta(i+1) = (theta(i) + theta(i+2))/2 – Pr*(h/2)*(theta(i+1)-theta(i))*H(i) + Pr*(h^2)*(S/2)*(((i*h+1)/2)*((theta(i+1)-theta(i))/h)+alpha1*theta(i)) – zeta*Pr*((h^2)/2)*((theta(i) -2*theta(i+1) + theta(i+2))/h^2 – 2*F(i)*H(i)*((theta(i+1)-theta(i))/h));
phi(i+1) = (phi(i) + phi(i+2))/2 + Sc*(h/2)*H(i)*(theta(i+1)-theta(i)) – Sc*(h^2)*(S/2)*(((i*h+1)/2)*((phi(i+1)-phi(i))/2*h)+alpha2*phi(i)) + (Sc/2)*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
Index exceeds the number of array elements. Index must not exceed 1. Line 39function FDMex()
N = 100;
h = 0.1;
eta = 0:h:N;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for j = 1:N+1
if (abs(H(j)-H1(j))>Ac); (abs(F(j)-F1(j))>Ac);(abs(G(j)-G1(j))>Ac);(abs(theta(1)-theta1(1))>Ac);(abs(phi(j)-phi1(j))>Ac);
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:0.1:N;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h)
for i = 1:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F(i)*((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = (G(i) + G(i+2))/2 -(h/2)*H(i)*(G(i+1)-G(i)) – (h^2)*F(i)*G(i) + (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i))/h)+G(i)) – (h^2)*k*(F(i)*((G(i) -2*G(i+1) + G(i+2))/h^2) – ((F(i+1)-F(i))/h)*((G(i+1)-G(i))/h));
theta(i+1) = (theta(i) + theta(i+2))/2 – Pr*(h/2)*(theta(i+1)-theta(i))*H(i) + Pr*(h^2)*(S/2)*(((i*h+1)/2)*((theta(i+1)-theta(i))/h)+alpha1*theta(i)) – zeta*Pr*((h^2)/2)*((theta(i) -2*theta(i+1) + theta(i+2))/h^2 – 2*F(i)*H(i)*((theta(i+1)-theta(i))/h));
phi(i+1) = (phi(i) + phi(i+2))/2 + Sc*(h/2)*H(i)*(theta(i+1)-theta(i)) – Sc*(h^2)*(S/2)*(((i*h+1)/2)*((phi(i+1)-phi(i))/2*h)+alpha2*phi(i)) + (Sc/2)*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
Index exceeds the number of array elements. Index must not exceed 1. Line 39 function FDMex()
N = 100;
h = 0.1;
eta = 0:h:N;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for j = 1:N+1
if (abs(H(j)-H1(j))>Ac); (abs(F(j)-F1(j))>Ac);(abs(G(j)-G1(j))>Ac);(abs(theta(1)-theta1(1))>Ac);(abs(phi(j)-phi1(j))>Ac);
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:0.1:N;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1, F1, G1, theta1, phi1] = equation(H,F,G,theta,phi,N,h)
for i = 1:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F(i)*((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = (G(i) + G(i+2))/2 -(h/2)*H(i)*(G(i+1)-G(i)) – (h^2)*F(i)*G(i) + (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i))/h)+G(i)) – (h^2)*k*(F(i)*((G(i) -2*G(i+1) + G(i+2))/h^2) – ((F(i+1)-F(i))/h)*((G(i+1)-G(i))/h));
theta(i+1) = (theta(i) + theta(i+2))/2 – Pr*(h/2)*(theta(i+1)-theta(i))*H(i) + Pr*(h^2)*(S/2)*(((i*h+1)/2)*((theta(i+1)-theta(i))/h)+alpha1*theta(i)) – zeta*Pr*((h^2)/2)*((theta(i) -2*theta(i+1) + theta(i+2))/h^2 – 2*F(i)*H(i)*((theta(i+1)-theta(i))/h));
phi(i+1) = (phi(i) + phi(i+2))/2 + Sc*(h/2)*H(i)*(theta(i+1)-theta(i)) – Sc*(h^2)*(S/2)*(((i*h+1)/2)*((phi(i+1)-phi(i))/2*h)+alpha2*phi(i)) + (Sc/2)*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
Index exceeds the number of array elements. Index must not exceed 1. Line 39 rashmi MATLAB Answers — New Questions
Subtract column values where leading columns have values flipped (i.e., (A,B,C1) – (B,A,C2))
Suppose I have a table, T:
A B C
1 6 10
2 5 20
3 4 30
4 3 45
5 2 6
6 1 10
I want to subtract each entry in column C where the A and B values are flipped, and put this value into column D
For example, the first row (1, 6, 10) – the last row (6, 1, 10); (2, 5, 20) – (5, 2, 6) and so on
So D should be:
0
14
-15
15
-14
0
Thanks a lot!
Edit: (i) Flipped rows could occur anywhere in the table; (ii) there may be repeated values in Α and BSuppose I have a table, T:
A B C
1 6 10
2 5 20
3 4 30
4 3 45
5 2 6
6 1 10
I want to subtract each entry in column C where the A and B values are flipped, and put this value into column D
For example, the first row (1, 6, 10) – the last row (6, 1, 10); (2, 5, 20) – (5, 2, 6) and so on
So D should be:
0
14
-15
15
-14
0
Thanks a lot!
Edit: (i) Flipped rows could occur anywhere in the table; (ii) there may be repeated values in Α and B Suppose I have a table, T:
A B C
1 6 10
2 5 20
3 4 30
4 3 45
5 2 6
6 1 10
I want to subtract each entry in column C where the A and B values are flipped, and put this value into column D
For example, the first row (1, 6, 10) – the last row (6, 1, 10); (2, 5, 20) – (5, 2, 6) and so on
So D should be:
0
14
-15
15
-14
0
Thanks a lot!
Edit: (i) Flipped rows could occur anywhere in the table; (ii) there may be repeated values in Α and B subtraction, tables values MATLAB Answers — New Questions
256QAM Rayleigh channel not able to locate 256 points in scatter plot Simulink.
In 256QAM Rayleigh channel LTE physical layer not able to locate all 256 points in scatter plot Simulink. Kindly helpIn 256QAM Rayleigh channel LTE physical layer not able to locate all 256 points in scatter plot Simulink. Kindly help In 256QAM Rayleigh channel LTE physical layer not able to locate all 256 points in scatter plot Simulink. Kindly help mobile communication, digital signal processing, digital communication MATLAB Answers — New Questions
H have a error in FDM.
FDMex()
function FDMex()
N = 100;
lgth = 1.0;
h = lgth/N;
eta = 0:h:lgth;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for i = 2:N-1
if (abs((H(i)-H1(i)), (F(i) – F1(i)), (G(i) – G1(i)),(theta(i) – theta1(i)), (phi(i) – phi1(i)))>Ac)
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:h:lgth;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h)
for i = 2:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = 2*G(i) – G(i+2) -(h/2)*H(i)*(G(i+1)-G(i+2)) + 2*F(i)*G(i) – (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i+2))/2*h)+G(i)) + (h^2)*2*k*(F(i)*((G(i+1) -2*G(i) + G(i+2))/h^2) – ((F(i+1)-F(i+2))/2*h)*((G(i+1)-G(i+2))/2*h));
theta(i+1) = 2*theta(i) – theta(i+2) + Pr*(h/2)*(theta(i+1)-theta(i+2)) – Pr*(h^2)*S*(((i*h+1)/2)*((theta(i+1)-theta(i+2))/2*h)+alpha1*theta(i)) + zeta*((theta(i+1) -2*theta(i) + theta(i+2))/h^2 – 2*F(i)*G(i)*((theta(i+1)-theta(i+2))/2*h)); phi(i+1) = 2*phi(i) – phi(i+2) + Sc*(h/2)*(theta(i+1)-theta(i+2)) – Sc*(h^2)*S*(((i*h+1)/2)*((phi(i+1)-theta(i+2))/2*h)+alpha2*phi(i)) + Sc*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
AArray indices must be positive integers or logical values.FDMex()
function FDMex()
N = 100;
lgth = 1.0;
h = lgth/N;
eta = 0:h:lgth;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for i = 2:N-1
if (abs((H(i)-H1(i)), (F(i) – F1(i)), (G(i) – G1(i)),(theta(i) – theta1(i)), (phi(i) – phi1(i)))>Ac)
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:h:lgth;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h)
for i = 2:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = 2*G(i) – G(i+2) -(h/2)*H(i)*(G(i+1)-G(i+2)) + 2*F(i)*G(i) – (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i+2))/2*h)+G(i)) + (h^2)*2*k*(F(i)*((G(i+1) -2*G(i) + G(i+2))/h^2) – ((F(i+1)-F(i+2))/2*h)*((G(i+1)-G(i+2))/2*h));
theta(i+1) = 2*theta(i) – theta(i+2) + Pr*(h/2)*(theta(i+1)-theta(i+2)) – Pr*(h^2)*S*(((i*h+1)/2)*((theta(i+1)-theta(i+2))/2*h)+alpha1*theta(i)) + zeta*((theta(i+1) -2*theta(i) + theta(i+2))/h^2 – 2*F(i)*G(i)*((theta(i+1)-theta(i+2))/2*h)); phi(i+1) = 2*phi(i) – phi(i+2) + Sc*(h/2)*(theta(i+1)-theta(i+2)) – Sc*(h^2)*S*(((i*h+1)/2)*((phi(i+1)-theta(i+2))/2*h)+alpha2*phi(i)) + Sc*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
AArray indices must be positive integers or logical values. FDMex()
function FDMex()
N = 100;
lgth = 1.0;
h = lgth/N;
eta = 0:h:lgth;
Ac = 0.0001;
S = 0.2;
k = 0.1;
Pr = 1.0;
Sc = 1.2;
alpha1 = 0.4;
alpha2 = 0;
zeta = 0.3;
gamma = 0.3;
omega = 0.4;
fw = 0.2;
F = zeros(N+2, 1);
G = zeros(N+2, 1);
theta = zeros(N+2, 1);
phi = zeros(N+2, 1);
H = zeros(N+2, 1);
F(1) = 0;
G(1) = omega;
theta(1) = 1;
phi(1) = 1;
H(1) = S + fw / Sc * (phi(2) – phi(1)) / h^2;
F(N+2) = 0;
G(N+2) = 0;
theta(N+2) = 0;
phi(N+2) = 0;
c = 1.0;
while(c>0)
[H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h);
c = 0.0;
for i = 2:N-1
if (abs((H(i)-H1(i)), (F(i) – F1(i)), (G(i) – G1(i)),(theta(i) – theta1(i)), (phi(i) – phi1(i)))>Ac)
c = c+1;
break
end
end
H = H1;
F = F1;
G = G1;
theta = theta1;
phi = phi1;
end
disp(‘Hence solutions = :’ );
H2(1 : N+2) = H;
F2(1 : N+2) = F;
G2(1 : N+2) = G;
theta2(1 : N+2) = theta;
phi2(1 : N+2) = phi;
eta = 0:h:lgth;
figure(1)
plot(eta,H2,’*r’)
hold on
function [H1,F1,G1,theta1,phi1] = equation(H,F,G,theta,phi,N,h)
for i = 2:N-1
H(i+1) = H(i) – h*2*F(i);
F(i+1) = (F(i) + F(i+2))/2 -H(i)*(h/2)*(F(i+1)-F(i)) +(h^2)*(G(i)^2) – (h^2)*(F(i)^2) + (h^2)*(S/2)*((((i*h)+1)/2)*((F(i+1)-F(i))/h)+F(i)) – (h^2)*(k/2)*(((G(i+1)-G(i))/h)^2 – ((F(i+1)-F(i))/h)^2+2*F((F(i) -2*F(i+1) + F(i+2))/h^2));
G(i+1) = 2*G(i) – G(i+2) -(h/2)*H(i)*(G(i+1)-G(i+2)) + 2*F(i)*G(i) – (h^2)*S*(((i*h+1)/2)*((G(i+1)-G(i+2))/2*h)+G(i)) + (h^2)*2*k*(F(i)*((G(i+1) -2*G(i) + G(i+2))/h^2) – ((F(i+1)-F(i+2))/2*h)*((G(i+1)-G(i+2))/2*h));
theta(i+1) = 2*theta(i) – theta(i+2) + Pr*(h/2)*(theta(i+1)-theta(i+2)) – Pr*(h^2)*S*(((i*h+1)/2)*((theta(i+1)-theta(i+2))/2*h)+alpha1*theta(i)) + zeta*((theta(i+1) -2*theta(i) + theta(i+2))/h^2 – 2*F(i)*G(i)*((theta(i+1)-theta(i+2))/2*h)); phi(i+1) = 2*phi(i) – phi(i+2) + Sc*(h/2)*(theta(i+1)-theta(i+2)) – Sc*(h^2)*S*(((i*h+1)/2)*((phi(i+1)-theta(i+2))/2*h)+alpha2*phi(i)) + Sc*(h^2)*gamma*phi(i);
end
H1(1) = H(1);
F1(1) = F(1);
G1(1) = G(1);
theta1(1) = theta(1);
phi1(1) = phi(1);
F1(N+2) = F(N+2);
G1(N+2) = G(N+2);
theta1(N+2) = theta(N+2);
phi1(N+2) = phi(N+2);
end
end
AArray indices must be positive integers or logical values. fdm MATLAB Answers — New Questions
When I run the commnad ControlSystemDesigner into MATLAB and the app opens, I dont see the label view on the upper window
When I run the commnad ControlSystemDesigner into MATLAB and the app opens, I dont see the label view on the upper windowWhen I run the commnad ControlSystemDesigner into MATLAB and the app opens, I dont see the label view on the upper window When I run the commnad ControlSystemDesigner into MATLAB and the app opens, I dont see the label view on the upper window controlsystemdesigner MATLAB Answers — New Questions
[Octave] Image Processing : Pixel Transformation and Quality Picture.
Hello everyone,
I’m still on the modeling of gravitational lensing.
I intended to proceed in a different method. Let me explain.
I intend to take a picture, for example, a sky with a galaxy. And model the image by a matrix. This matrix would actually be of size N * M (where N is the pixel length of the image and M, the width)
Each pixel would therefore a number of the matrix.
I have two perspectives:
First, create a map as modeling the geometric changes applied to our image (to represent the bending of light rays) and then apply to the image.
The second, operate directly on the image without using a tier modeling.
My result should look like this:
http://www.epm6604b.be/lentille/images/imginfluence/m31_trou_noir.jpg
A=imread(‘galaxy.jpg’)
% Liste des Variables
[nr,nc]= size([A])
x1=y1=500 % Position de la masse défléctrice
R= 1 %Rayon de la masse déflectrice (exemple de trou noir = 1 pixel)
largeur = nc %largeur de l’image
longeur = nr %longueur de l’image
Ralpha=(sqrt((x-x1).^2+(y-y1).^2))
L=(4.*G*M)./(c^2)
% Les Constantes
G= 6.67e-11
c=3.0e+8
M= 1,7e+38 %Masse de la masse déflectrice
z2 = 9,5e+15 %Distance de la masse par rapport à la galaxie
z1= 2,75e+22 %Distance par rapport à la Terre
% Lentille gravitationnelle
B=[]
for i=1:largeur
for j= 1:longueur
if sqrt((x-x1).^2+(y-y1).^2)<=R:
A(i,j)= 0 % pixel noir
if sqrt((x-x1).^2+(y-y1).^2)>R:
x[i]=i+z2.*((i./z1)-(L/R).*i/R)
y[j]=j+z2.*((j./z1)-(L/R).*j/R)
A(i,j)=B(x[i],y[j])
imread(B)
end
% code
I tried to do it for transformations. If i try to change A(i,j) to A(x4,y4) i will change the original pixel wich locate in (x,y) but when the programm will go to A(x4,y4) throught i,j coordonate.
The pixel itself has already been moved, it will not change the original pixel but the pixel from (i, j) already transformed. So how can we apply transformations while telling it not to apply transformations on the transformed pixel but the original pixel in this position previously.
Here i try to create an other matrix B which contains all transformation (or value pixel with relocation).
Next problem : Quality picture:
If i apply these transformations in A matrix, i will lose in image quality? Because when i transformed my image in A matrix, Octave noticed that :
"Warning : Your Version of GraphicsMagick limits images to 8 bits per pixel"
That’s why i would like to know if it could be better to call the image in an other way to keep the original quality picture. But if i must do that, i don’t know how… :/
Excuse me for my expression, but i’m not english.
Thx in AdvanceHello everyone,
I’m still on the modeling of gravitational lensing.
I intended to proceed in a different method. Let me explain.
I intend to take a picture, for example, a sky with a galaxy. And model the image by a matrix. This matrix would actually be of size N * M (where N is the pixel length of the image and M, the width)
Each pixel would therefore a number of the matrix.
I have two perspectives:
First, create a map as modeling the geometric changes applied to our image (to represent the bending of light rays) and then apply to the image.
The second, operate directly on the image without using a tier modeling.
My result should look like this:
http://www.epm6604b.be/lentille/images/imginfluence/m31_trou_noir.jpg
A=imread(‘galaxy.jpg’)
% Liste des Variables
[nr,nc]= size([A])
x1=y1=500 % Position de la masse défléctrice
R= 1 %Rayon de la masse déflectrice (exemple de trou noir = 1 pixel)
largeur = nc %largeur de l’image
longeur = nr %longueur de l’image
Ralpha=(sqrt((x-x1).^2+(y-y1).^2))
L=(4.*G*M)./(c^2)
% Les Constantes
G= 6.67e-11
c=3.0e+8
M= 1,7e+38 %Masse de la masse déflectrice
z2 = 9,5e+15 %Distance de la masse par rapport à la galaxie
z1= 2,75e+22 %Distance par rapport à la Terre
% Lentille gravitationnelle
B=[]
for i=1:largeur
for j= 1:longueur
if sqrt((x-x1).^2+(y-y1).^2)<=R:
A(i,j)= 0 % pixel noir
if sqrt((x-x1).^2+(y-y1).^2)>R:
x[i]=i+z2.*((i./z1)-(L/R).*i/R)
y[j]=j+z2.*((j./z1)-(L/R).*j/R)
A(i,j)=B(x[i],y[j])
imread(B)
end
% code
I tried to do it for transformations. If i try to change A(i,j) to A(x4,y4) i will change the original pixel wich locate in (x,y) but when the programm will go to A(x4,y4) throught i,j coordonate.
The pixel itself has already been moved, it will not change the original pixel but the pixel from (i, j) already transformed. So how can we apply transformations while telling it not to apply transformations on the transformed pixel but the original pixel in this position previously.
Here i try to create an other matrix B which contains all transformation (or value pixel with relocation).
Next problem : Quality picture:
If i apply these transformations in A matrix, i will lose in image quality? Because when i transformed my image in A matrix, Octave noticed that :
"Warning : Your Version of GraphicsMagick limits images to 8 bits per pixel"
That’s why i would like to know if it could be better to call the image in an other way to keep the original quality picture. But if i must do that, i don’t know how… :/
Excuse me for my expression, but i’m not english.
Thx in Advance Hello everyone,
I’m still on the modeling of gravitational lensing.
I intended to proceed in a different method. Let me explain.
I intend to take a picture, for example, a sky with a galaxy. And model the image by a matrix. This matrix would actually be of size N * M (where N is the pixel length of the image and M, the width)
Each pixel would therefore a number of the matrix.
I have two perspectives:
First, create a map as modeling the geometric changes applied to our image (to represent the bending of light rays) and then apply to the image.
The second, operate directly on the image without using a tier modeling.
My result should look like this:
http://www.epm6604b.be/lentille/images/imginfluence/m31_trou_noir.jpg
A=imread(‘galaxy.jpg’)
% Liste des Variables
[nr,nc]= size([A])
x1=y1=500 % Position de la masse défléctrice
R= 1 %Rayon de la masse déflectrice (exemple de trou noir = 1 pixel)
largeur = nc %largeur de l’image
longeur = nr %longueur de l’image
Ralpha=(sqrt((x-x1).^2+(y-y1).^2))
L=(4.*G*M)./(c^2)
% Les Constantes
G= 6.67e-11
c=3.0e+8
M= 1,7e+38 %Masse de la masse déflectrice
z2 = 9,5e+15 %Distance de la masse par rapport à la galaxie
z1= 2,75e+22 %Distance par rapport à la Terre
% Lentille gravitationnelle
B=[]
for i=1:largeur
for j= 1:longueur
if sqrt((x-x1).^2+(y-y1).^2)<=R:
A(i,j)= 0 % pixel noir
if sqrt((x-x1).^2+(y-y1).^2)>R:
x[i]=i+z2.*((i./z1)-(L/R).*i/R)
y[j]=j+z2.*((j./z1)-(L/R).*j/R)
A(i,j)=B(x[i],y[j])
imread(B)
end
% code
I tried to do it for transformations. If i try to change A(i,j) to A(x4,y4) i will change the original pixel wich locate in (x,y) but when the programm will go to A(x4,y4) throught i,j coordonate.
The pixel itself has already been moved, it will not change the original pixel but the pixel from (i, j) already transformed. So how can we apply transformations while telling it not to apply transformations on the transformed pixel but the original pixel in this position previously.
Here i try to create an other matrix B which contains all transformation (or value pixel with relocation).
Next problem : Quality picture:
If i apply these transformations in A matrix, i will lose in image quality? Because when i transformed my image in A matrix, Octave noticed that :
"Warning : Your Version of GraphicsMagick limits images to 8 bits per pixel"
That’s why i would like to know if it could be better to call the image in an other way to keep the original quality picture. But if i must do that, i don’t know how… :/
Excuse me for my expression, but i’m not english.
Thx in Advance image processing, pixel, matrix, simulation MATLAB Answers — New Questions
why I can’t save everything into a Matlab Script file?
%First set of polynomials
p1 = [15 9 -22];
p2 = [8 -17 -12];
P = p1 + p2;
disp(‘The sum of the polynomial is’)
disp(P)
%Second Set of Polynomials
x1 = [7 0 -3];
x2 = [-15 -13 18];
X = x1 + x2;
disp(‘The sum of the polynomial is’)
disp(X)
%Expanding first expression
syms x y
B = (3*x + 4*y)^3;
A = expand (B);
disp(‘Expanded form of (3x + 4y)^3:’);
disp(A);
%Expanding second expression
syms m n
B = (5*m^2 + 4*n^2)^5;
A = expand (B);
disp(‘Expanded form of (5*m^2 + 4*n^2)^5’);
disp(A);
%factoring first polynomial
syms a;
A = (a^3 + 5*a^2 – 2*a-24);
B = factor (A);
disp(‘Factor form of (a^3 + 5*a^2 – 2*a-24) ‘);
disp(B);
%factoring second polynomial
syms x
A = 4*x^3 + 3*x^2 – 25*x + 6;
B = factor(A);
disp(‘Factored form of 4x^3 + 3x^2 – 25x + 6:’);
disp(B);
%factoring third polynomial
syms x
A = x^4 – 10*x^2 + 9;
B = factor (A);
disp(‘Factored form of x^4 – 10*x^2 + 9:’);
disp(B);
CAN’T SAVE AS MATLAB SCRIPT FILE%First set of polynomials
p1 = [15 9 -22];
p2 = [8 -17 -12];
P = p1 + p2;
disp(‘The sum of the polynomial is’)
disp(P)
%Second Set of Polynomials
x1 = [7 0 -3];
x2 = [-15 -13 18];
X = x1 + x2;
disp(‘The sum of the polynomial is’)
disp(X)
%Expanding first expression
syms x y
B = (3*x + 4*y)^3;
A = expand (B);
disp(‘Expanded form of (3x + 4y)^3:’);
disp(A);
%Expanding second expression
syms m n
B = (5*m^2 + 4*n^2)^5;
A = expand (B);
disp(‘Expanded form of (5*m^2 + 4*n^2)^5’);
disp(A);
%factoring first polynomial
syms a;
A = (a^3 + 5*a^2 – 2*a-24);
B = factor (A);
disp(‘Factor form of (a^3 + 5*a^2 – 2*a-24) ‘);
disp(B);
%factoring second polynomial
syms x
A = 4*x^3 + 3*x^2 – 25*x + 6;
B = factor(A);
disp(‘Factored form of 4x^3 + 3x^2 – 25x + 6:’);
disp(B);
%factoring third polynomial
syms x
A = x^4 – 10*x^2 + 9;
B = factor (A);
disp(‘Factored form of x^4 – 10*x^2 + 9:’);
disp(B);
CAN’T SAVE AS MATLAB SCRIPT FILE %First set of polynomials
p1 = [15 9 -22];
p2 = [8 -17 -12];
P = p1 + p2;
disp(‘The sum of the polynomial is’)
disp(P)
%Second Set of Polynomials
x1 = [7 0 -3];
x2 = [-15 -13 18];
X = x1 + x2;
disp(‘The sum of the polynomial is’)
disp(X)
%Expanding first expression
syms x y
B = (3*x + 4*y)^3;
A = expand (B);
disp(‘Expanded form of (3x + 4y)^3:’);
disp(A);
%Expanding second expression
syms m n
B = (5*m^2 + 4*n^2)^5;
A = expand (B);
disp(‘Expanded form of (5*m^2 + 4*n^2)^5’);
disp(A);
%factoring first polynomial
syms a;
A = (a^3 + 5*a^2 – 2*a-24);
B = factor (A);
disp(‘Factor form of (a^3 + 5*a^2 – 2*a-24) ‘);
disp(B);
%factoring second polynomial
syms x
A = 4*x^3 + 3*x^2 – 25*x + 6;
B = factor(A);
disp(‘Factored form of 4x^3 + 3x^2 – 25x + 6:’);
disp(B);
%factoring third polynomial
syms x
A = x^4 – 10*x^2 + 9;
B = factor (A);
disp(‘Factored form of x^4 – 10*x^2 + 9:’);
disp(B);
CAN’T SAVE AS MATLAB SCRIPT FILE syms, matlab, saving MATLAB Answers — New Questions
Performing convolution – 3 signals are convolving with three corresponding signal ?
I have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (of equal number of rows) and giving three outputs. I am using following code and it is working:
synth = conv2(wav_near’, trc);
t0_i = floor(t0/dt); Nl = 101;
synth = synth(1+t0_i:Nl+t0_i,:);
Now, I have three wav (108 3) and want to convolve with trc (120 3) in way like the first wav will convolve with first trc, second wav with second trc and so on. I have attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but not working. How can I change the above code in this case.
The size of outcomes should be the size of trc.
One way I tried like but results are not same
synth = zeros(120, 3);
% Loop through each column
for col = 1:3
conv_result = conv2(wav(:, col), trc(:, col), ‘full’)
start_idx = floor((length(wav(:, col)) – 1) / 2) + 1;
end_idx = start_idx + 120 – 1;
synth(:, col) = conv_result(start_idx:end_idx);
endI have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (of equal number of rows) and giving three outputs. I am using following code and it is working:
synth = conv2(wav_near’, trc);
t0_i = floor(t0/dt); Nl = 101;
synth = synth(1+t0_i:Nl+t0_i,:);
Now, I have three wav (108 3) and want to convolve with trc (120 3) in way like the first wav will convolve with first trc, second wav with second trc and so on. I have attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but not working. How can I change the above code in this case.
The size of outcomes should be the size of trc.
One way I tried like but results are not same
synth = zeros(120, 3);
% Loop through each column
for col = 1:3
conv_result = conv2(wav(:, col), trc(:, col), ‘full’)
start_idx = floor((length(wav(:, col)) – 1) / 2) + 1;
end_idx = start_idx + 120 – 1;
synth(:, col) = conv_result(start_idx:end_idx);
end I have attached the data and facing a following problem.
In a first step I am convolving a wav (101 1) with trc (101 3) e.g., a single wav is being convolved three trc (of equal number of rows) and giving three outputs. I am using following code and it is working:
synth = conv2(wav_near’, trc);
t0_i = floor(t0/dt); Nl = 101;
synth = synth(1+t0_i:Nl+t0_i,:);
Now, I have three wav (108 3) and want to convolve with trc (120 3) in way like the first wav will convolve with first trc, second wav with second trc and so on. I have attaced all the three wav (wav_near, wav_mid, wav_far) and trc. I tried a lot of combinations but not working. How can I change the above code in this case.
The size of outcomes should be the size of trc.
One way I tried like but results are not same
synth = zeros(120, 3);
% Loop through each column
for col = 1:3
conv_result = conv2(wav(:, col), trc(:, col), ‘full’)
start_idx = floor((length(wav(:, col)) – 1) / 2) + 1;
end_idx = start_idx + 120 – 1;
synth(:, col) = conv_result(start_idx:end_idx);
end matlab code, matlab, matrices MATLAB Answers — New Questions
problem launching the course
while i launch the course of the 2 hours it stucks in every try.while i launch the course of the 2 hours it stucks in every try. while i launch the course of the 2 hours it stucks in every try. matlab, error, course MATLAB Answers — New Questions
Error using matlab.internal.math.interp1 Input coordinates must be real.
global vlast1 vlast2 beta delta theta k0 kt At p1 p2
hold off
hold all
vlast1=20*ones(1,40);
vlast2=vlast1;
k0=0.4:0.4:16;
kt11=k0;
kt12=k0;
beta=0.98;
delta=0.1;
theta=0.36;
A1=1.75;
p11=0.9;
p12=1-p11;
p21=0.4;
p22=1-p21;
A2=0.75;
numits=250;
for k=1:numits
for j=1:40
kt=k0(j);
At=A1;
p1=p11;
p2=p12;
%we are using a bounded function minimization routine here
z=fminbnd(@valfunsto,0.41,15.99);
v1(j)=-valfunsto(z);
kt11(j)=z;
At=A2;
p1=p21;
p2=p22;
z=fminbnd(@valfunsto,0.41,15.99);
v2(j)=-valfunsto(z);
kt12(j)=z;
end
if k/50==round(k/50)
plot(k0,v1,k0,v2)
drawnow
end
vlast1=v1;
vlast2=v2;
end
hold off
%optimal plotting prgram for the plans
%plot(k0,kt11,k0,kt12)
function val=valfunsto(k)
global vlast1 vlast2 beta delta theta k0 kt At p1 p2
g1=interp1(k0,vlast1,k,’linear’);
g2=interp1(k0,vlast2,k,’linear’);
kk=At*kt^theta-k+(1-delta)*kt;
val=log(kk)+beta*(p1*g1+p2*g2);
val=-val;
end
This codes from the textbook The ABCs of RBCs. Once I run them, the error-
Error using matlab.internal.math.interp1
Input coordinates must be real
keeps coming up. Is there anything wrong with the code?global vlast1 vlast2 beta delta theta k0 kt At p1 p2
hold off
hold all
vlast1=20*ones(1,40);
vlast2=vlast1;
k0=0.4:0.4:16;
kt11=k0;
kt12=k0;
beta=0.98;
delta=0.1;
theta=0.36;
A1=1.75;
p11=0.9;
p12=1-p11;
p21=0.4;
p22=1-p21;
A2=0.75;
numits=250;
for k=1:numits
for j=1:40
kt=k0(j);
At=A1;
p1=p11;
p2=p12;
%we are using a bounded function minimization routine here
z=fminbnd(@valfunsto,0.41,15.99);
v1(j)=-valfunsto(z);
kt11(j)=z;
At=A2;
p1=p21;
p2=p22;
z=fminbnd(@valfunsto,0.41,15.99);
v2(j)=-valfunsto(z);
kt12(j)=z;
end
if k/50==round(k/50)
plot(k0,v1,k0,v2)
drawnow
end
vlast1=v1;
vlast2=v2;
end
hold off
%optimal plotting prgram for the plans
%plot(k0,kt11,k0,kt12)
function val=valfunsto(k)
global vlast1 vlast2 beta delta theta k0 kt At p1 p2
g1=interp1(k0,vlast1,k,’linear’);
g2=interp1(k0,vlast2,k,’linear’);
kk=At*kt^theta-k+(1-delta)*kt;
val=log(kk)+beta*(p1*g1+p2*g2);
val=-val;
end
This codes from the textbook The ABCs of RBCs. Once I run them, the error-
Error using matlab.internal.math.interp1
Input coordinates must be real
keeps coming up. Is there anything wrong with the code? global vlast1 vlast2 beta delta theta k0 kt At p1 p2
hold off
hold all
vlast1=20*ones(1,40);
vlast2=vlast1;
k0=0.4:0.4:16;
kt11=k0;
kt12=k0;
beta=0.98;
delta=0.1;
theta=0.36;
A1=1.75;
p11=0.9;
p12=1-p11;
p21=0.4;
p22=1-p21;
A2=0.75;
numits=250;
for k=1:numits
for j=1:40
kt=k0(j);
At=A1;
p1=p11;
p2=p12;
%we are using a bounded function minimization routine here
z=fminbnd(@valfunsto,0.41,15.99);
v1(j)=-valfunsto(z);
kt11(j)=z;
At=A2;
p1=p21;
p2=p22;
z=fminbnd(@valfunsto,0.41,15.99);
v2(j)=-valfunsto(z);
kt12(j)=z;
end
if k/50==round(k/50)
plot(k0,v1,k0,v2)
drawnow
end
vlast1=v1;
vlast2=v2;
end
hold off
%optimal plotting prgram for the plans
%plot(k0,kt11,k0,kt12)
function val=valfunsto(k)
global vlast1 vlast2 beta delta theta k0 kt At p1 p2
g1=interp1(k0,vlast1,k,’linear’);
g2=interp1(k0,vlast2,k,’linear’);
kk=At*kt^theta-k+(1-delta)*kt;
val=log(kk)+beta*(p1*g1+p2*g2);
val=-val;
end
This codes from the textbook The ABCs of RBCs. Once I run them, the error-
Error using matlab.internal.math.interp1
Input coordinates must be real
keeps coming up. Is there anything wrong with the code? interp1 error MATLAB Answers — New Questions
why does matlab invent decimal numbers?
long = 2.305800000000000e+03;
short= 8.694000000000000e+02;
prof=3.175200000000000e+03
dail=long+short
dail-prof
%{
In my count: daily=2305.8+869.4=3175.2
dail-prof=0 but matlab write dail-prof=4.5475e-13
why does matlab add infinitesimals of decimals to me?
i see https://it.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html#f2-98690
but I didn’t find it useful
%}long = 2.305800000000000e+03;
short= 8.694000000000000e+02;
prof=3.175200000000000e+03
dail=long+short
dail-prof
%{
In my count: daily=2305.8+869.4=3175.2
dail-prof=0 but matlab write dail-prof=4.5475e-13
why does matlab add infinitesimals of decimals to me?
i see https://it.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html#f2-98690
but I didn’t find it useful
%} long = 2.305800000000000e+03;
short= 8.694000000000000e+02;
prof=3.175200000000000e+03
dail=long+short
dail-prof
%{
In my count: daily=2305.8+869.4=3175.2
dail-prof=0 but matlab write dail-prof=4.5475e-13
why does matlab add infinitesimals of decimals to me?
i see https://it.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html#f2-98690
but I didn’t find it useful
%} why does matlab invent decimal numbers? MATLAB Answers — New Questions
customlized AMD rfsoc board support package configure error
We build a custom hardware board base on AMD rfsoc 27dr, follow the
https://ww2.mathworks.cn/help/soc/ug/create-board-support-framework.html
https://www.youtube.com/watch?v=m5Rfqz2gteE
success build a boardSupportPackage, and install it in mathworks R2023b system, but when apply this custom board to the ‘soc_rfsoc_datacapture’ case, can’t pass configure steps. The simulink report :
Error:A dot ‘.’ indexing expression produced a comma-separated list with 2 values where only a single value is allowed.
I am sure this is ok if we choose the hardware board ‘Xilinx Zynq ultraScale+ RFSoC ZCU111…’, that means, the error is maybe due to our boardSupportPackage.
The attached file is the boardSupportPackage create script.
best regards for reply.We build a custom hardware board base on AMD rfsoc 27dr, follow the
https://ww2.mathworks.cn/help/soc/ug/create-board-support-framework.html
https://www.youtube.com/watch?v=m5Rfqz2gteE
success build a boardSupportPackage, and install it in mathworks R2023b system, but when apply this custom board to the ‘soc_rfsoc_datacapture’ case, can’t pass configure steps. The simulink report :
Error:A dot ‘.’ indexing expression produced a comma-separated list with 2 values where only a single value is allowed.
I am sure this is ok if we choose the hardware board ‘Xilinx Zynq ultraScale+ RFSoC ZCU111…’, that means, the error is maybe due to our boardSupportPackage.
The attached file is the boardSupportPackage create script.
best regards for reply. We build a custom hardware board base on AMD rfsoc 27dr, follow the
https://ww2.mathworks.cn/help/soc/ug/create-board-support-framework.html
https://www.youtube.com/watch?v=m5Rfqz2gteE
success build a boardSupportPackage, and install it in mathworks R2023b system, but when apply this custom board to the ‘soc_rfsoc_datacapture’ case, can’t pass configure steps. The simulink report :
Error:A dot ‘.’ indexing expression produced a comma-separated list with 2 values where only a single value is allowed.
I am sure this is ok if we choose the hardware board ‘Xilinx Zynq ultraScale+ RFSoC ZCU111…’, that means, the error is maybe due to our boardSupportPackage.
The attached file is the boardSupportPackage create script.
best regards for reply. soc blockset, custom board support package, configure error MATLAB Answers — New Questions
Issues Running MATLAB Compiled Program in Docker on ARM Mac
Hello,
I’m encountering an issue running a MATLAB compiled program using MCR (2021b) in a Docker container on an ARM-based Mac using Rosetta 2 for x86_64 emulation. The program fails to initialize with the following error:
"Error: Message Catalog has not been initialized by a successful call to MessageCatalog::MessageCatalogInit"
The compiled MATLAB program and MCR are for x86_64 architecture (amd64).
Environment:
Host: ARM-based Mac (Apple Silicon)
Docker with Rosetta 2 support for x86_64 emulation
Container OS: Ubuntu 18.04.6 LTS (x86_64)
MATLAB Compiler Runtime (MCR) version: R2021b (v9.11)
What I’ve tried:
Verified all required libraries are present and correctly linked (using ldd).
Confirmed MCR installation appears correct (directory structure and permissions).
Ran strace, which showed the process switching between 64-bit and x32 modes.
Checked disk space
Attempted to run both the compiled program directly and through its run script.
Additional Information:
The compiled MATLAB program and MCR are for x86_64 architecture.
Using VZ (Virtualization.framework) with Rosetta support, not QEMU.
glibc version in the container: 2.27 (compatible with MCR R2021b)
Docker file and docker commands, I used
FROM –platform=linux/amd64 containers.mathworks.com/matlab-runtime:r2021b
ENV DEBIAN_FRONTEND noninteractive
ENV MCR_ROOT /opt/matlabruntime/v911
ENV LD_LIBRARY_PATH ${MCR_ROOT}/runtime/glnxa64:${MCR_ROOT}/bin/glnxa64:${MCR_ROOT}/sys/os/glnxa64:${MCR_ROOT}/extern/bin/glnxa64
ENV XAPPLRESDIR /etc/X11/app-defaults
ENV MCR_CACHE_ROOT /tmp
ENV MCR_MASTER_PATH ${MCR_ROOT}
# Copy your compiled MATLAB script and any necessary files into the container
COPY matlab_scripts/matlab_compiled_app /app/matlab_compiled_app
COPY matlab_scripts/run_matlab_compiled_app.sh /app/run_matlab_compiled_app.sh
# Ensure the script is executable
RUN chmod +x /app/run_matlab_compiled_app
# Set the working directory
WORKDIR /app
# Command to run the script
#CMD ["./run_matlab_compiled_app.sh"]
I used the following command to build the container:
docker build –platform linux/amd64 -f Dockerfile-mcr-r2021b –no-cache –tag mydomain/matlab-runtime:r2021b .
and the following command to run the container :
docker run –platform linux/amd64 -it –rm -v ./my_data/:/app/my_data mydomain/matlab-runtime:r2021b /bin/bash
Questions:
Has anyone successfully run MATLAB compiled programs in a similar setup (Docker + Rosetta 2 on ARM Mac)?
Are there known issues or workarounds for running MCR-based applications under Rosetta emulation?
Could the architecture mismatch (x86_64 program on ARM host) be causing the initialization failure?
Are there specific Docker or Rosetta settings that need to be adjusted for proper MCR initialization?
Any insights, suggestions for further debugging, or potential solutions would be greatly appreciated. Thank you!Hello,
I’m encountering an issue running a MATLAB compiled program using MCR (2021b) in a Docker container on an ARM-based Mac using Rosetta 2 for x86_64 emulation. The program fails to initialize with the following error:
"Error: Message Catalog has not been initialized by a successful call to MessageCatalog::MessageCatalogInit"
The compiled MATLAB program and MCR are for x86_64 architecture (amd64).
Environment:
Host: ARM-based Mac (Apple Silicon)
Docker with Rosetta 2 support for x86_64 emulation
Container OS: Ubuntu 18.04.6 LTS (x86_64)
MATLAB Compiler Runtime (MCR) version: R2021b (v9.11)
What I’ve tried:
Verified all required libraries are present and correctly linked (using ldd).
Confirmed MCR installation appears correct (directory structure and permissions).
Ran strace, which showed the process switching between 64-bit and x32 modes.
Checked disk space
Attempted to run both the compiled program directly and through its run script.
Additional Information:
The compiled MATLAB program and MCR are for x86_64 architecture.
Using VZ (Virtualization.framework) with Rosetta support, not QEMU.
glibc version in the container: 2.27 (compatible with MCR R2021b)
Docker file and docker commands, I used
FROM –platform=linux/amd64 containers.mathworks.com/matlab-runtime:r2021b
ENV DEBIAN_FRONTEND noninteractive
ENV MCR_ROOT /opt/matlabruntime/v911
ENV LD_LIBRARY_PATH ${MCR_ROOT}/runtime/glnxa64:${MCR_ROOT}/bin/glnxa64:${MCR_ROOT}/sys/os/glnxa64:${MCR_ROOT}/extern/bin/glnxa64
ENV XAPPLRESDIR /etc/X11/app-defaults
ENV MCR_CACHE_ROOT /tmp
ENV MCR_MASTER_PATH ${MCR_ROOT}
# Copy your compiled MATLAB script and any necessary files into the container
COPY matlab_scripts/matlab_compiled_app /app/matlab_compiled_app
COPY matlab_scripts/run_matlab_compiled_app.sh /app/run_matlab_compiled_app.sh
# Ensure the script is executable
RUN chmod +x /app/run_matlab_compiled_app
# Set the working directory
WORKDIR /app
# Command to run the script
#CMD ["./run_matlab_compiled_app.sh"]
I used the following command to build the container:
docker build –platform linux/amd64 -f Dockerfile-mcr-r2021b –no-cache –tag mydomain/matlab-runtime:r2021b .
and the following command to run the container :
docker run –platform linux/amd64 -it –rm -v ./my_data/:/app/my_data mydomain/matlab-runtime:r2021b /bin/bash
Questions:
Has anyone successfully run MATLAB compiled programs in a similar setup (Docker + Rosetta 2 on ARM Mac)?
Are there known issues or workarounds for running MCR-based applications under Rosetta emulation?
Could the architecture mismatch (x86_64 program on ARM host) be causing the initialization failure?
Are there specific Docker or Rosetta settings that need to be adjusted for proper MCR initialization?
Any insights, suggestions for further debugging, or potential solutions would be greatly appreciated. Thank you! Hello,
I’m encountering an issue running a MATLAB compiled program using MCR (2021b) in a Docker container on an ARM-based Mac using Rosetta 2 for x86_64 emulation. The program fails to initialize with the following error:
"Error: Message Catalog has not been initialized by a successful call to MessageCatalog::MessageCatalogInit"
The compiled MATLAB program and MCR are for x86_64 architecture (amd64).
Environment:
Host: ARM-based Mac (Apple Silicon)
Docker with Rosetta 2 support for x86_64 emulation
Container OS: Ubuntu 18.04.6 LTS (x86_64)
MATLAB Compiler Runtime (MCR) version: R2021b (v9.11)
What I’ve tried:
Verified all required libraries are present and correctly linked (using ldd).
Confirmed MCR installation appears correct (directory structure and permissions).
Ran strace, which showed the process switching between 64-bit and x32 modes.
Checked disk space
Attempted to run both the compiled program directly and through its run script.
Additional Information:
The compiled MATLAB program and MCR are for x86_64 architecture.
Using VZ (Virtualization.framework) with Rosetta support, not QEMU.
glibc version in the container: 2.27 (compatible with MCR R2021b)
Docker file and docker commands, I used
FROM –platform=linux/amd64 containers.mathworks.com/matlab-runtime:r2021b
ENV DEBIAN_FRONTEND noninteractive
ENV MCR_ROOT /opt/matlabruntime/v911
ENV LD_LIBRARY_PATH ${MCR_ROOT}/runtime/glnxa64:${MCR_ROOT}/bin/glnxa64:${MCR_ROOT}/sys/os/glnxa64:${MCR_ROOT}/extern/bin/glnxa64
ENV XAPPLRESDIR /etc/X11/app-defaults
ENV MCR_CACHE_ROOT /tmp
ENV MCR_MASTER_PATH ${MCR_ROOT}
# Copy your compiled MATLAB script and any necessary files into the container
COPY matlab_scripts/matlab_compiled_app /app/matlab_compiled_app
COPY matlab_scripts/run_matlab_compiled_app.sh /app/run_matlab_compiled_app.sh
# Ensure the script is executable
RUN chmod +x /app/run_matlab_compiled_app
# Set the working directory
WORKDIR /app
# Command to run the script
#CMD ["./run_matlab_compiled_app.sh"]
I used the following command to build the container:
docker build –platform linux/amd64 -f Dockerfile-mcr-r2021b –no-cache –tag mydomain/matlab-runtime:r2021b .
and the following command to run the container :
docker run –platform linux/amd64 -it –rm -v ./my_data/:/app/my_data mydomain/matlab-runtime:r2021b /bin/bash
Questions:
Has anyone successfully run MATLAB compiled programs in a similar setup (Docker + Rosetta 2 on ARM Mac)?
Are there known issues or workarounds for running MCR-based applications under Rosetta emulation?
Could the architecture mismatch (x86_64 program on ARM host) be causing the initialization failure?
Are there specific Docker or Rosetta settings that need to be adjusted for proper MCR initialization?
Any insights, suggestions for further debugging, or potential solutions would be greatly appreciated. Thank you! mcr, container, docker, runtime, amd64, arm64, mac MATLAB Answers — New Questions
Explaining a matlab code
Hello, and thank you for taking your time to read this message. I just want to understand how does this code work line by line.
R = input(‘Enter radii [R1, R2, R3]: ‘);
theta = input(‘Enter angles [theta1, theta2, theta3] in degrees: ‘);
stopping_criterion = input(‘Enter stopping criterion for Newton-Raphson iterations: ‘);
% Choose solution method
disp(‘Choose a solution method:’);
disp(‘1. Gauss-Elimination with partial pivoting’);
disp(‘2. Cramer Rule’);
disp(‘3. Naïve Gauss-Jordan’);
method = input(‘Enter the method number: ‘);
if method < 1 || method > 3
error(‘Invalid method number’);
end
f = @(params) [params(1)/(1 + params(2) * sind(theta(1) + params(3))) – R(1);
params(1)/(1 + params(2) * sind(theta(2) + params(3))) – R(2);
params(1)/(1 + params(2) * sind(theta(3) + params(3))) – R(3)];
C = 1000;
e = 0.5;
alpha = 30;
relative_errors_C = zeros(100, 1);
relative_errors_e = zeros(100, 1);
relative_errors_alpha = zeros(100, 1);
for iteration = 1:100
J = numerical_jacobian(f, [C, e, alpha]);
if det(J) == 0
error(‘The Jacobian matrix is not invertible. The Newton-Raphson method cannot be used.’);
end
switch method
case 1
update = gauss_elimination_pivoting(J, f([C, e, alpha]));
case 2
update = cramers_rule_solver(J, f([C, e, alpha]));
case 3
update = naive_gauss_jordan(J, f([C, e, alpha]));
end
% Check for convergence
if norm(update) < stopping_criterion
% Update constants
C = C – update(1);
e = e – update(2);
alpha = alpha – update(3);
relative_errors_C(iteration) = abs(update(1) / C);
relative_errors_e(iteration) = abs(update(2) / e);
relative_errors_alpha(iteration) = abs(update(3) / alpha);
fprintf(‘Iteration %d: Relative Error in C = %f, e = %f, alpha = %fn’, iteration, relative_errors_C(iteration), relative_errors_e(iteration), relative_errors_alpha(iteration));
break;
end
end
figure;
subplot(3, 1, 1);
plot(1:iteration, relative_errors_C(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in C’);
title(‘Convergence’);
subplot(3, 1, 2);
plot(1:iteration, relative_errors_e(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in e’);
subplot(3, 1, 3);
plot(1:iteration, relative_errors_alpha(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in alpha’);
fprintf(‘Final values:nC = %fn e = %fn alpha = %fn’, C, e, alpha);
theta_values = linspace(0, 360, 1000);
R_values = C./(1 + e * sind(theta_values + alpha));
figure;
polarplot(deg2rad(theta_values), R_values);
hold on;
polarplot(deg2rad(theta), R, ‘ro’);
title(‘Satellite Orbit’);
legend(‘Orbit’, ‘Data Points’);
hold off;
function J = numerical_jacobian(f, params)
n = length(params);
m = length(f(params));
J = zeros(m, n);
delta = 1e-8;
for i = 1:n
params_plus = params;
params_minus = params;
params_plus(i) = params_plus(i) + delta;
params_minus(i) = params_minus(i) – delta;
J(:, i) = (f(params_plus) – f(params_minus)) / (2 * delta);
end
endHello, and thank you for taking your time to read this message. I just want to understand how does this code work line by line.
R = input(‘Enter radii [R1, R2, R3]: ‘);
theta = input(‘Enter angles [theta1, theta2, theta3] in degrees: ‘);
stopping_criterion = input(‘Enter stopping criterion for Newton-Raphson iterations: ‘);
% Choose solution method
disp(‘Choose a solution method:’);
disp(‘1. Gauss-Elimination with partial pivoting’);
disp(‘2. Cramer Rule’);
disp(‘3. Naïve Gauss-Jordan’);
method = input(‘Enter the method number: ‘);
if method < 1 || method > 3
error(‘Invalid method number’);
end
f = @(params) [params(1)/(1 + params(2) * sind(theta(1) + params(3))) – R(1);
params(1)/(1 + params(2) * sind(theta(2) + params(3))) – R(2);
params(1)/(1 + params(2) * sind(theta(3) + params(3))) – R(3)];
C = 1000;
e = 0.5;
alpha = 30;
relative_errors_C = zeros(100, 1);
relative_errors_e = zeros(100, 1);
relative_errors_alpha = zeros(100, 1);
for iteration = 1:100
J = numerical_jacobian(f, [C, e, alpha]);
if det(J) == 0
error(‘The Jacobian matrix is not invertible. The Newton-Raphson method cannot be used.’);
end
switch method
case 1
update = gauss_elimination_pivoting(J, f([C, e, alpha]));
case 2
update = cramers_rule_solver(J, f([C, e, alpha]));
case 3
update = naive_gauss_jordan(J, f([C, e, alpha]));
end
% Check for convergence
if norm(update) < stopping_criterion
% Update constants
C = C – update(1);
e = e – update(2);
alpha = alpha – update(3);
relative_errors_C(iteration) = abs(update(1) / C);
relative_errors_e(iteration) = abs(update(2) / e);
relative_errors_alpha(iteration) = abs(update(3) / alpha);
fprintf(‘Iteration %d: Relative Error in C = %f, e = %f, alpha = %fn’, iteration, relative_errors_C(iteration), relative_errors_e(iteration), relative_errors_alpha(iteration));
break;
end
end
figure;
subplot(3, 1, 1);
plot(1:iteration, relative_errors_C(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in C’);
title(‘Convergence’);
subplot(3, 1, 2);
plot(1:iteration, relative_errors_e(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in e’);
subplot(3, 1, 3);
plot(1:iteration, relative_errors_alpha(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in alpha’);
fprintf(‘Final values:nC = %fn e = %fn alpha = %fn’, C, e, alpha);
theta_values = linspace(0, 360, 1000);
R_values = C./(1 + e * sind(theta_values + alpha));
figure;
polarplot(deg2rad(theta_values), R_values);
hold on;
polarplot(deg2rad(theta), R, ‘ro’);
title(‘Satellite Orbit’);
legend(‘Orbit’, ‘Data Points’);
hold off;
function J = numerical_jacobian(f, params)
n = length(params);
m = length(f(params));
J = zeros(m, n);
delta = 1e-8;
for i = 1:n
params_plus = params;
params_minus = params;
params_plus(i) = params_plus(i) + delta;
params_minus(i) = params_minus(i) – delta;
J(:, i) = (f(params_plus) – f(params_minus)) / (2 * delta);
end
end Hello, and thank you for taking your time to read this message. I just want to understand how does this code work line by line.
R = input(‘Enter radii [R1, R2, R3]: ‘);
theta = input(‘Enter angles [theta1, theta2, theta3] in degrees: ‘);
stopping_criterion = input(‘Enter stopping criterion for Newton-Raphson iterations: ‘);
% Choose solution method
disp(‘Choose a solution method:’);
disp(‘1. Gauss-Elimination with partial pivoting’);
disp(‘2. Cramer Rule’);
disp(‘3. Naïve Gauss-Jordan’);
method = input(‘Enter the method number: ‘);
if method < 1 || method > 3
error(‘Invalid method number’);
end
f = @(params) [params(1)/(1 + params(2) * sind(theta(1) + params(3))) – R(1);
params(1)/(1 + params(2) * sind(theta(2) + params(3))) – R(2);
params(1)/(1 + params(2) * sind(theta(3) + params(3))) – R(3)];
C = 1000;
e = 0.5;
alpha = 30;
relative_errors_C = zeros(100, 1);
relative_errors_e = zeros(100, 1);
relative_errors_alpha = zeros(100, 1);
for iteration = 1:100
J = numerical_jacobian(f, [C, e, alpha]);
if det(J) == 0
error(‘The Jacobian matrix is not invertible. The Newton-Raphson method cannot be used.’);
end
switch method
case 1
update = gauss_elimination_pivoting(J, f([C, e, alpha]));
case 2
update = cramers_rule_solver(J, f([C, e, alpha]));
case 3
update = naive_gauss_jordan(J, f([C, e, alpha]));
end
% Check for convergence
if norm(update) < stopping_criterion
% Update constants
C = C – update(1);
e = e – update(2);
alpha = alpha – update(3);
relative_errors_C(iteration) = abs(update(1) / C);
relative_errors_e(iteration) = abs(update(2) / e);
relative_errors_alpha(iteration) = abs(update(3) / alpha);
fprintf(‘Iteration %d: Relative Error in C = %f, e = %f, alpha = %fn’, iteration, relative_errors_C(iteration), relative_errors_e(iteration), relative_errors_alpha(iteration));
break;
end
end
figure;
subplot(3, 1, 1);
plot(1:iteration, relative_errors_C(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in C’);
title(‘Convergence’);
subplot(3, 1, 2);
plot(1:iteration, relative_errors_e(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in e’);
subplot(3, 1, 3);
plot(1:iteration, relative_errors_alpha(1:iteration), ‘o-‘);
xlabel(‘Iteration’);
ylabel(‘Relative Error in alpha’);
fprintf(‘Final values:nC = %fn e = %fn alpha = %fn’, C, e, alpha);
theta_values = linspace(0, 360, 1000);
R_values = C./(1 + e * sind(theta_values + alpha));
figure;
polarplot(deg2rad(theta_values), R_values);
hold on;
polarplot(deg2rad(theta), R, ‘ro’);
title(‘Satellite Orbit’);
legend(‘Orbit’, ‘Data Points’);
hold off;
function J = numerical_jacobian(f, params)
n = length(params);
m = length(f(params));
J = zeros(m, n);
delta = 1e-8;
for i = 1:n
params_plus = params;
params_minus = params;
params_plus(i) = params_plus(i) + delta;
params_minus(i) = params_minus(i) – delta;
J(:, i) = (f(params_plus) – f(params_minus)) / (2 * delta);
end
end matlab ai chatbot, large language model, llm, matlab playground MATLAB Answers — New Questions
Warning: Initializing MATLAB Graphics failed
I recently upgraded matlab2024a, but as soon as I open the software I get the following warning message :
Warning: Failed to initialize MATLAB graphics.
This indicates that there may be a serious problem in your MATLAB setup that should be resolved as soon as possible. The error detected is: MATLAB:sum:wrongInput
MATLAB:sum:wrongInput
Invalid data type. The first parameter must be a numeric or logical value.
> Location: hgrc (line 154)
Location: matlab.graphics.internal.initialize (line 15)I recently upgraded matlab2024a, but as soon as I open the software I get the following warning message :
Warning: Failed to initialize MATLAB graphics.
This indicates that there may be a serious problem in your MATLAB setup that should be resolved as soon as possible. The error detected is: MATLAB:sum:wrongInput
MATLAB:sum:wrongInput
Invalid data type. The first parameter must be a numeric or logical value.
> Location: hgrc (line 154)
Location: matlab.graphics.internal.initialize (line 15) I recently upgraded matlab2024a, but as soon as I open the software I get the following warning message :
Warning: Failed to initialize MATLAB graphics.
This indicates that there may be a serious problem in your MATLAB setup that should be resolved as soon as possible. The error detected is: MATLAB:sum:wrongInput
MATLAB:sum:wrongInput
Invalid data type. The first parameter must be a numeric or logical value.
> Location: hgrc (line 154)
Location: matlab.graphics.internal.initialize (line 15) matlab warning MATLAB Answers — New Questions
Sensitivity analysis using MATLAB
I am doing a project on epidemic models. I have derived a formula for basic reproduction number and now I want to analysis its sensitivity to different parameters in the formula. I have come across PRCC (Partial Rank Correlation Coefficient) analysis (which makes use of Latin Hypercube Sampling, I suppose – I am not sure). How can I do this sort of sensitivity analysis using MATLAB?I am doing a project on epidemic models. I have derived a formula for basic reproduction number and now I want to analysis its sensitivity to different parameters in the formula. I have come across PRCC (Partial Rank Correlation Coefficient) analysis (which makes use of Latin Hypercube Sampling, I suppose – I am not sure). How can I do this sort of sensitivity analysis using MATLAB? I am doing a project on epidemic models. I have derived a formula for basic reproduction number and now I want to analysis its sensitivity to different parameters in the formula. I have come across PRCC (Partial Rank Correlation Coefficient) analysis (which makes use of Latin Hypercube Sampling, I suppose – I am not sure). How can I do this sort of sensitivity analysis using MATLAB? partial rank correlation coefficient, latin hypercube sampling, sensitivity analysis MATLAB Answers — New Questions
How to make Synthesis nonlinear spring
How can i make synthesis of nonlinear springHow can i make synthesis of nonlinear spring How can i make synthesis of nonlinear spring optimization MATLAB Answers — New Questions
Fuel cell lookup table
The fuel cell lookup table generated from the spreadsheet via-https://ww2.mathworks.cn/help/autoblks/ug/generate-mapped-fuel-cell-from-a-spreadsheet.html
However, based on the data,the fuel cell efficiency looks always over 60% which is unrealistic.
Is there something wrong from built-in spreadsheet?The fuel cell lookup table generated from the spreadsheet via-https://ww2.mathworks.cn/help/autoblks/ug/generate-mapped-fuel-cell-from-a-spreadsheet.html
However, based on the data,the fuel cell efficiency looks always over 60% which is unrealistic.
Is there something wrong from built-in spreadsheet? The fuel cell lookup table generated from the spreadsheet via-https://ww2.mathworks.cn/help/autoblks/ug/generate-mapped-fuel-cell-from-a-spreadsheet.html
However, based on the data,the fuel cell efficiency looks always over 60% which is unrealistic.
Is there something wrong from built-in spreadsheet? fuel cell, lookup table, efficiency, heat flow MATLAB Answers — New Questions
I am having trouble reading a txt file
I have txt file with data formated below but Im only get the first line .
index: 0 int_time: 1718984569904518 us int_diff: 0 us min: 167 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
here is the code im using utilising textscan
fid=fopen(‘Desktopdata.txt’,’rt’);
data=textscan(fid,’%[index: 0 int_time:] %u64 %[us_int_diff: ] %s %s %s %s %s %s %s %s’)
fclose(fid);I have txt file with data formated below but Im only get the first line .
index: 0 int_time: 1718984569904518 us int_diff: 0 us min: 167 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
here is the code im using utilising textscan
fid=fopen(‘Desktopdata.txt’,’rt’);
data=textscan(fid,’%[index: 0 int_time:] %u64 %[us_int_diff: ] %s %s %s %s %s %s %s %s’)
fclose(fid); I have txt file with data formated below but Im only get the first line .
index: 0 int_time: 1718984569904518 us int_diff: 0 us min: 167 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
index: 1 int_time: 1718984569904682 us int_diff: 164 us min: 164 us max: 167 us
here is the code im using utilising textscan
fid=fopen(‘Desktopdata.txt’,’rt’);
data=textscan(fid,’%[index: 0 int_time:] %u64 %[us_int_diff: ] %s %s %s %s %s %s %s %s’)
fclose(fid); textscan MATLAB Answers — New Questions