Tag Archives: matlab
Error data corruption
Hi, does anyone knows the reason why a received file (video file) have the full size however cannot playback in the windows media player?It stated..Unknown file error.
Does anyone knows why?Is it due to manipulation of my coding?Hi, does anyone knows the reason why a received file (video file) have the full size however cannot playback in the windows media player?It stated..Unknown file error.
Does anyone knows why?Is it due to manipulation of my coding? Hi, does anyone knows the reason why a received file (video file) have the full size however cannot playback in the windows media player?It stated..Unknown file error.
Does anyone knows why?Is it due to manipulation of my coding? for, data corruption, matlab, preallocation MATLAB Answers — New Questions
FFT Code generation for VxWorks
Is it possible to generate C code for FFT and IFFT (from Simulink) for deployment in VxWorks? Can you please provide documentation on how to doIs it possible to generate C code for FFT and IFFT (from Simulink) for deployment in VxWorks? Can you please provide documentation on how to do Is it possible to generate C code for FFT and IFFT (from Simulink) for deployment in VxWorks? Can you please provide documentation on how to do fft c code generation, ifft, simulink, vxworks MATLAB Answers — New Questions
Is edge detection (e.g., Rising, falling) in State flow supports code generation using embedded coder?
While generating code Error comes as "Error:Error: File: C:Program FilesMATLABR2023brtwctlcpublic_apidiagnostics_api.tlc Line: 39 Column: 10 %exit directive: Simulink Coder Fatal: Custom Data Error: Empty DataObject record"
Please support me to resolve this issue.
Thank YouWhile generating code Error comes as "Error:Error: File: C:Program FilesMATLABR2023brtwctlcpublic_apidiagnostics_api.tlc Line: 39 Column: 10 %exit directive: Simulink Coder Fatal: Custom Data Error: Empty DataObject record"
Please support me to resolve this issue.
Thank You While generating code Error comes as "Error:Error: File: C:Program FilesMATLABR2023brtwctlcpublic_apidiagnostics_api.tlc Line: 39 Column: 10 %exit directive: Simulink Coder Fatal: Custom Data Error: Empty DataObject record"
Please support me to resolve this issue.
Thank You simulink, stateflow, embedded coder MATLAB Answers — New Questions
code folding in live scripts
Is code folding in live scripts possible as in .m?Is code folding in live scripts possible as in .m? Is code folding in live scripts possible as in .m? live script MATLAB Answers — New Questions
Bounding box example with image
Hi,
Can someone give a picture example / link for bounding box for image processing / computer vision?
Regards,Hi,
Can someone give a picture example / link for bounding box for image processing / computer vision?
Regards, Hi,
Can someone give a picture example / link for bounding box for image processing / computer vision?
Regards, image processing, computer vision MATLAB Answers — New Questions
Creating TuningGoals for delay margin and multivariable margin.
I want to use systune to tune gains for my Simulink model, using the slTuner interface. I am trying to set up a non-smooth, multi-objective optimization problem that can be solved by systune. However, I am having a difficult time figuring out how to set up two of the hard constraints.
The optimization problem is stated as follows:
minimize
subject to <
<
>
> 0.3
I think I have the soft constraints and first two hard constraints correctly implemented now, using TuningGoal.Variance. However, I have no idea how to properly set up the last two hard constraints. These are the dynamic margin (generalized delay margin) at and the multivarible module margin of . Where is the complementary sensitivity function and is the sensitivity function.
mdl = "TestVehicleModel";
open_system(mdl);
st0 = slTuner(mdl,"TuneGain");
Softreq1 = TuningGoal.Variance("u1","y1",1);
Softreq2 = TuningGoal.Variance("u2","y1",1);
Softreq3 = TuningGoal.Variance("u1","y2",1);
Softreq4 = TuningGoal.Variance("u2","y2",1);
Hardreq1 = TuningGoal.Variance("u1","y3",0.5);
Hardreq2 = TuningGoal.Variance("u2","y3",0.5);
[st, fSoft, gHard] = systune(st0,[Softreq1,Softreq2,Softreq3,Softreq4],[Hardreq1,Hardreq2]);
Can anyone help me with this? I know that it should be possible, as some researches have done it before in previous versions of MATLAB, probably 2018a.I want to use systune to tune gains for my Simulink model, using the slTuner interface. I am trying to set up a non-smooth, multi-objective optimization problem that can be solved by systune. However, I am having a difficult time figuring out how to set up two of the hard constraints.
The optimization problem is stated as follows:
minimize
subject to <
<
>
> 0.3
I think I have the soft constraints and first two hard constraints correctly implemented now, using TuningGoal.Variance. However, I have no idea how to properly set up the last two hard constraints. These are the dynamic margin (generalized delay margin) at and the multivarible module margin of . Where is the complementary sensitivity function and is the sensitivity function.
mdl = "TestVehicleModel";
open_system(mdl);
st0 = slTuner(mdl,"TuneGain");
Softreq1 = TuningGoal.Variance("u1","y1",1);
Softreq2 = TuningGoal.Variance("u2","y1",1);
Softreq3 = TuningGoal.Variance("u1","y2",1);
Softreq4 = TuningGoal.Variance("u2","y2",1);
Hardreq1 = TuningGoal.Variance("u1","y3",0.5);
Hardreq2 = TuningGoal.Variance("u2","y3",0.5);
[st, fSoft, gHard] = systune(st0,[Softreq1,Softreq2,Softreq3,Softreq4],[Hardreq1,Hardreq2]);
Can anyone help me with this? I know that it should be possible, as some researches have done it before in previous versions of MATLAB, probably 2018a. I want to use systune to tune gains for my Simulink model, using the slTuner interface. I am trying to set up a non-smooth, multi-objective optimization problem that can be solved by systune. However, I am having a difficult time figuring out how to set up two of the hard constraints.
The optimization problem is stated as follows:
minimize
subject to <
<
>
> 0.3
I think I have the soft constraints and first two hard constraints correctly implemented now, using TuningGoal.Variance. However, I have no idea how to properly set up the last two hard constraints. These are the dynamic margin (generalized delay margin) at and the multivarible module margin of . Where is the complementary sensitivity function and is the sensitivity function.
mdl = "TestVehicleModel";
open_system(mdl);
st0 = slTuner(mdl,"TuneGain");
Softreq1 = TuningGoal.Variance("u1","y1",1);
Softreq2 = TuningGoal.Variance("u2","y1",1);
Softreq3 = TuningGoal.Variance("u1","y2",1);
Softreq4 = TuningGoal.Variance("u2","y2",1);
Hardreq1 = TuningGoal.Variance("u1","y3",0.5);
Hardreq2 = TuningGoal.Variance("u2","y3",0.5);
[st, fSoft, gHard] = systune(st0,[Softreq1,Softreq2,Softreq3,Softreq4],[Hardreq1,Hardreq2]);
Can anyone help me with this? I know that it should be possible, as some researches have done it before in previous versions of MATLAB, probably 2018a. sltuner, optimization, non-smooth, multi-objective, systune, tuninggoal, simulink, matlab, hinfinity, margin MATLAB Answers — New Questions
Plot time on x axis for 24 hours duration
How can i plot my data against time on x axis which is 24 hours duration split every two hours.
Sample has been attached here.How can i plot my data against time on x axis which is 24 hours duration split every two hours.
Sample has been attached here. How can i plot my data against time on x axis which is 24 hours duration split every two hours.
Sample has been attached here. plot MATLAB Answers — New Questions
How to connect a Subsystem’s outputPorts (more than 5) to “Bus Creator” programmatically (from scripting)
Hi, Suppose I have Subsystems block which has outputs more than 5.
I have added "Bus Creator" using:
add_block("simulink/Commonly Used Blocks/Bus Creator","testing_bus/Bus Creator")
This is creating Bus in testing_bus model with only 2 input ports. Is there a way to create a "Bus Creator" with number of inputs = Size of Subsystem’s Outputports?
(or)
edit the number of input port of "Bus Creator" so that later using for loop, for connections by:
add_line(‘testing_bus’,’Subsystem/1′,’Bus Creator/1′);Hi, Suppose I have Subsystems block which has outputs more than 5.
I have added "Bus Creator" using:
add_block("simulink/Commonly Used Blocks/Bus Creator","testing_bus/Bus Creator")
This is creating Bus in testing_bus model with only 2 input ports. Is there a way to create a "Bus Creator" with number of inputs = Size of Subsystem’s Outputports?
(or)
edit the number of input port of "Bus Creator" so that later using for loop, for connections by:
add_line(‘testing_bus’,’Subsystem/1′,’Bus Creator/1′); Hi, Suppose I have Subsystems block which has outputs more than 5.
I have added "Bus Creator" using:
add_block("simulink/Commonly Used Blocks/Bus Creator","testing_bus/Bus Creator")
This is creating Bus in testing_bus model with only 2 input ports. Is there a way to create a "Bus Creator" with number of inputs = Size of Subsystem’s Outputports?
(or)
edit the number of input port of "Bus Creator" so that later using for loop, for connections by:
add_line(‘testing_bus’,’Subsystem/1′,’Bus Creator/1′); bus creator, bus, script, simulink MATLAB Answers — New Questions
my code wont display figure
% Parameters
L = 1; % Length of the string
c = 1; % Wave speed
num_segments = 200; % Number of segments
dx = L / num_segments; % Discretization step
dt = 0.005; % Time step
num_steps = 10 / dt; % Number of time steps
% Initial wave parameters
left_wave_length = 0.15 * L;
right_wave_length = 0.25 * L;
% Initialize the wave function
x = 0:dx:L;
u = sin(pi * x / left_wave_length) + sin(2 * pi * x / right_wave_length);
% Time integration
for step = 1:num_steps
% Compute second spatial derivative using finite differences
u_xx = (u(1:end-2) – 2*u(2:end-1) + u(3:end)) / dx^2;
% Update the wave equation using finite differences
u_new = 2*u(2:end-1) – u(2:end-1) + c^2 * dt^2 * u_xx;
% Update boundary conditions
u_new1 = [0, u_new, 0];
% Update the wave function
u = u_new1;
end
% Plot at t = 0
figure;
plot(x, u);
title(‘Wave Equation at t = 0’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]);
% Plot at t = 10 [t]
figure;
plot(x, u);
title(‘Wave Equation at t = 10 [t]’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]);% Parameters
L = 1; % Length of the string
c = 1; % Wave speed
num_segments = 200; % Number of segments
dx = L / num_segments; % Discretization step
dt = 0.005; % Time step
num_steps = 10 / dt; % Number of time steps
% Initial wave parameters
left_wave_length = 0.15 * L;
right_wave_length = 0.25 * L;
% Initialize the wave function
x = 0:dx:L;
u = sin(pi * x / left_wave_length) + sin(2 * pi * x / right_wave_length);
% Time integration
for step = 1:num_steps
% Compute second spatial derivative using finite differences
u_xx = (u(1:end-2) – 2*u(2:end-1) + u(3:end)) / dx^2;
% Update the wave equation using finite differences
u_new = 2*u(2:end-1) – u(2:end-1) + c^2 * dt^2 * u_xx;
% Update boundary conditions
u_new1 = [0, u_new, 0];
% Update the wave function
u = u_new1;
end
% Plot at t = 0
figure;
plot(x, u);
title(‘Wave Equation at t = 0’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]);
% Plot at t = 10 [t]
figure;
plot(x, u);
title(‘Wave Equation at t = 10 [t]’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]); % Parameters
L = 1; % Length of the string
c = 1; % Wave speed
num_segments = 200; % Number of segments
dx = L / num_segments; % Discretization step
dt = 0.005; % Time step
num_steps = 10 / dt; % Number of time steps
% Initial wave parameters
left_wave_length = 0.15 * L;
right_wave_length = 0.25 * L;
% Initialize the wave function
x = 0:dx:L;
u = sin(pi * x / left_wave_length) + sin(2 * pi * x / right_wave_length);
% Time integration
for step = 1:num_steps
% Compute second spatial derivative using finite differences
u_xx = (u(1:end-2) – 2*u(2:end-1) + u(3:end)) / dx^2;
% Update the wave equation using finite differences
u_new = 2*u(2:end-1) – u(2:end-1) + c^2 * dt^2 * u_xx;
% Update boundary conditions
u_new1 = [0, u_new, 0];
% Update the wave function
u = u_new1;
end
% Plot at t = 0
figure;
plot(x, u);
title(‘Wave Equation at t = 0’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]);
% Plot at t = 10 [t]
figure;
plot(x, u);
title(‘Wave Equation at t = 10 [t]’);
xlabel(‘Position [L]’);
ylabel(‘Amplitude’);
xlim([0, L]); matlab MATLAB Answers — New Questions
How do i plot this solutions?
Hello,
I want to plot the theta2 values on the x and presures (P2_ALL) on a plot. It seems my pressures are in symbolic form so Im using fplot to plot. When I do this it gives me an error. Does anyone know how to fix this?
clc; clearvars
format short g
M1 = 3 ;
P1 = 1 ;
theta2 = 1:1:30 ;
gamma = 1.4 ;
phi = 4.8 ;
syms beta2
tantheta2 = tand(theta2 );
x = 2*cotd(beta2)*((M1^2*((sind(beta2)).^2)-1 ));
y = M1^2*(gamma+cosd(2*beta2))+2 ;
eqn2 = x/y ;
b0=1 ;
for ii=1:numel(theta2 )
T = tantheta2(ii );
clearvars result2
syms beta2
result2 = vpasolve(T== eqn2, beta2,b0 );
beta2 = vpa(result2 );
Mn1 = M1*sind(beta2); % Eqn 4.7 from Anderson’s
p2p1 = 1+((2*gamma)/(gamma+1))*(Mn1^2-1); % Eqn 4.9 from Anderson’s
Mn2sq= (Mn1^2+(2/(gamma-1)))/((2*gamma/(gamma-1))*Mn1^2-1);% Eqn 4.10 from Anderson’s
Mn2 = sqrt(Mn2sq );
M2 = Mn2/sind(beta2-theta2(ii ));
P2 = p2p1*P1 ;
P2_ALL{ii}=vpa(P2) ;
end
fplot(theta2,P2_ALL)Hello,
I want to plot the theta2 values on the x and presures (P2_ALL) on a plot. It seems my pressures are in symbolic form so Im using fplot to plot. When I do this it gives me an error. Does anyone know how to fix this?
clc; clearvars
format short g
M1 = 3 ;
P1 = 1 ;
theta2 = 1:1:30 ;
gamma = 1.4 ;
phi = 4.8 ;
syms beta2
tantheta2 = tand(theta2 );
x = 2*cotd(beta2)*((M1^2*((sind(beta2)).^2)-1 ));
y = M1^2*(gamma+cosd(2*beta2))+2 ;
eqn2 = x/y ;
b0=1 ;
for ii=1:numel(theta2 )
T = tantheta2(ii );
clearvars result2
syms beta2
result2 = vpasolve(T== eqn2, beta2,b0 );
beta2 = vpa(result2 );
Mn1 = M1*sind(beta2); % Eqn 4.7 from Anderson’s
p2p1 = 1+((2*gamma)/(gamma+1))*(Mn1^2-1); % Eqn 4.9 from Anderson’s
Mn2sq= (Mn1^2+(2/(gamma-1)))/((2*gamma/(gamma-1))*Mn1^2-1);% Eqn 4.10 from Anderson’s
Mn2 = sqrt(Mn2sq );
M2 = Mn2/sind(beta2-theta2(ii ));
P2 = p2p1*P1 ;
P2_ALL{ii}=vpa(P2) ;
end
fplot(theta2,P2_ALL) Hello,
I want to plot the theta2 values on the x and presures (P2_ALL) on a plot. It seems my pressures are in symbolic form so Im using fplot to plot. When I do this it gives me an error. Does anyone know how to fix this?
clc; clearvars
format short g
M1 = 3 ;
P1 = 1 ;
theta2 = 1:1:30 ;
gamma = 1.4 ;
phi = 4.8 ;
syms beta2
tantheta2 = tand(theta2 );
x = 2*cotd(beta2)*((M1^2*((sind(beta2)).^2)-1 ));
y = M1^2*(gamma+cosd(2*beta2))+2 ;
eqn2 = x/y ;
b0=1 ;
for ii=1:numel(theta2 )
T = tantheta2(ii );
clearvars result2
syms beta2
result2 = vpasolve(T== eqn2, beta2,b0 );
beta2 = vpa(result2 );
Mn1 = M1*sind(beta2); % Eqn 4.7 from Anderson’s
p2p1 = 1+((2*gamma)/(gamma+1))*(Mn1^2-1); % Eqn 4.9 from Anderson’s
Mn2sq= (Mn1^2+(2/(gamma-1)))/((2*gamma/(gamma-1))*Mn1^2-1);% Eqn 4.10 from Anderson’s
Mn2 = sqrt(Mn2sq );
M2 = Mn2/sind(beta2-theta2(ii ));
P2 = p2p1*P1 ;
P2_ALL{ii}=vpa(P2) ;
end
fplot(theta2,P2_ALL) fplot, solutions, ploting MATLAB Answers — New Questions
How to create an LC parametric attenuation circuit in simulink.
The terminals are LC only, L=0.1H and C=0.25F with an initial voltage of 1V. The variable capacitor has an initial capacitance of 0.25F and is increased by 0.25F each time the voltage takes an extreme value. The judgment of the extreme value is made by the derivative block, which outputs an impulse signal when hitcrossing becomes 0. Q=CV, and since Q is conserved, C is increased so that V is attenuated.The circuit I am currently working on is as follows, but it does not work well.
The ideal graph is as follows.The terminals are LC only, L=0.1H and C=0.25F with an initial voltage of 1V. The variable capacitor has an initial capacitance of 0.25F and is increased by 0.25F each time the voltage takes an extreme value. The judgment of the extreme value is made by the derivative block, which outputs an impulse signal when hitcrossing becomes 0. Q=CV, and since Q is conserved, C is increased so that V is attenuated.The circuit I am currently working on is as follows, but it does not work well.
The ideal graph is as follows. The terminals are LC only, L=0.1H and C=0.25F with an initial voltage of 1V. The variable capacitor has an initial capacitance of 0.25F and is increased by 0.25F each time the voltage takes an extreme value. The judgment of the extreme value is made by the derivative block, which outputs an impulse signal when hitcrossing becomes 0. Q=CV, and since Q is conserved, C is increased so that V is attenuated.The circuit I am currently working on is as follows, but it does not work well.
The ideal graph is as follows. simulink, variable capacitor, lc MATLAB Answers — New Questions
How to save the graph obtained with Simulink’s scope as numerical data
I have plotted voltage and current using the scope. I want to save the waveforms as a table of time and voltage values with a sampling time of 0.001 seconds.I have plotted voltage and current using the scope. I want to save the waveforms as a table of time and voltage values with a sampling time of 0.001 seconds. I have plotted voltage and current using the scope. I want to save the waveforms as a table of time and voltage values with a sampling time of 0.001 seconds. simulink MATLAB Answers — New Questions
How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files?
%How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
t2=Lc2.*c.*H+sigma2.*tan(P)
eq=Wr2+t2==F.*(F2+Fbc2+Fbr2)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
elseif app.Button.Value==1
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
t1=Lc1.*c.*H+sigma1.*tan(P)
eq=Wr1+t1==F.*(F1+Fbc1+Fbr1)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
end%How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
t2=Lc2.*c.*H+sigma2.*tan(P)
eq=Wr2+t2==F.*(F2+Fbc2+Fbr2)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
elseif app.Button.Value==1
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
t1=Lc1.*c.*H+sigma1.*tan(P)
eq=Wr1+t1==F.*(F1+Fbc1+Fbr1)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
end %How to effectively solve the problem of incompatibility of AppDesigner using symbol toolkit syms after packaging and publishing into exe and other executable files? And how can I change it in my code
cla(app.UIAxes)
P=app.PEditField.Value
P=P.*pi/180;
c=app.CKPaEditField.Value;
K=app.KEditField.Value;%侧压力系数
P_ya=app.P_yaEditField.Value;
F=app.FEditField.Value;
y=app.yKNm3EditField.Value;
R = app.RmEditField.Value;
L=app.LmEditField.Value;
L_s=app.L_smEditField.Value;
syms pha H
term1 = 9 – 12 * (1 – P_ya .* F ./ (y .* H));
term2 = R .* sqrt(term1) – 3 .* R;
denominator = 2 .* H;
% 计算 pha
pha = atan(term2 ./ denominator);
% 显示结果
% disp(pha);
pha_rad=rad2deg(pha);
H_vals = linspace(50, 250, 50);
pha_vals = double(subs(pha_rad, H, H_vals));
% Plot H versus pha
% figure(1);
plot(app.UIAxes,H_vals, pha_vals, ‘b-‘, ‘LineWidth’, 2);
xlabel(app.UIAxes,’H’);
ylabel(app.UIAxes,’pha’);
title(app.UIAxes,’Plot of pha vs H’);
% grid on;
% disp(pha_rad);
%修正破裂角计算
if K <= 1
pha_rad = 45 – P / 2;
elseif K <= 2
pha_rad = 45;
else
pha_rad = 45 + P / 2;
end
% 限制 pha_rad 的值在 15° 和 65° 之间
pha_rad = max(15, min(pha_rad, 65));
pha_rad = pha_rad * (pi / 180);
switch app.DropDown.Value
case ‘竖直滑面法’
if app.Button_2.Value==1
Vc2=4.*pi.*R.^3+pi.*R.^2*(L-2.*R);%体积
Ac2=pi.*R.^2+(L-2.*R).*2.*R;
Lc2=2*pi.*R+(L-2*R).*2;%周长
sigma2=Lc2.*H.*K.*y.*H./2;
Fbc2=Vc2.*10;%
Fbr2=Ac2.*10.*(H-L_s);
F2=Ac2.*P_ya;
Wr2=y.*H.*Ac2;%
t2=Lc2.*c.*H+sigma2.*tan(P)
eq=Wr2+t2==F.*(F2+Fbc2+Fbr2)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
elseif app.Button.Value==1
Vc1=4.*pi.*R.^3;%体积
Ac1=pi.*R.^2;%表面积
Lc1=2*pi.*R;%周长
sigma1=Lc1.*H.*K.*y.*H./2;%水平应力和∑σh
Fbc1=Vc1.*10;%硐室浮力
Fbr1=Ac1.*10.*(H-L_s);%岩体浮力
F1=Ac1.*P_ya;%上抬力
Wr1=y.*H.*Ac1;%重量
t1=Lc1.*c.*H+sigma1.*tan(P)
eq=Wr1+t1==F.*(F1+Fbc1+Fbr1)
H_solution = double(solve(eq, H));
positiveValues = H_solution(H_solution > 0);
app.HEditField.Value=positiveValues;
app.Image.ImageSource = ‘竖直滑面法示意图.png’; % 直接用路径
app.Image_2.ImageSource = ‘竖直滑面法示意图2.png’; % 直接用路径
end matlab gui MATLAB Answers — New Questions
Can anyone help me in understanding of deconvolution based on toeplitz matrix?
First of all, d is a trace whose size is (1,2500), p is a trace whose size is (1,2500).
For d*w=p, which is Dw=p, where D is Toeplitz matrix made by d. Take d and p as an example [1 2 3 4 5].
I construct D that the first column is [1 2 3 4 5 0 0 0 0], the first row is [1 0 0 0 0], which means d lags 2 time step up and 2 time step down, the 0 time lag is place 3 when the first place is 1.
To find w, I use deconvolution, therefore, w=((D^T)D)^(-1)(D^T)p
Confusion comes in here. the number of row of D is 9, however, the p is (1,5) size, how should I concatenate p using 0? Just under the last element of p or two 0 before and two 0 behind?
What I really want to know is the exact form of deconvoution in programs. Really Really appraciate it if anyone could help. Please!First of all, d is a trace whose size is (1,2500), p is a trace whose size is (1,2500).
For d*w=p, which is Dw=p, where D is Toeplitz matrix made by d. Take d and p as an example [1 2 3 4 5].
I construct D that the first column is [1 2 3 4 5 0 0 0 0], the first row is [1 0 0 0 0], which means d lags 2 time step up and 2 time step down, the 0 time lag is place 3 when the first place is 1.
To find w, I use deconvolution, therefore, w=((D^T)D)^(-1)(D^T)p
Confusion comes in here. the number of row of D is 9, however, the p is (1,5) size, how should I concatenate p using 0? Just under the last element of p or two 0 before and two 0 behind?
What I really want to know is the exact form of deconvoution in programs. Really Really appraciate it if anyone could help. Please! First of all, d is a trace whose size is (1,2500), p is a trace whose size is (1,2500).
For d*w=p, which is Dw=p, where D is Toeplitz matrix made by d. Take d and p as an example [1 2 3 4 5].
I construct D that the first column is [1 2 3 4 5 0 0 0 0], the first row is [1 0 0 0 0], which means d lags 2 time step up and 2 time step down, the 0 time lag is place 3 when the first place is 1.
To find w, I use deconvolution, therefore, w=((D^T)D)^(-1)(D^T)p
Confusion comes in here. the number of row of D is 9, however, the p is (1,5) size, how should I concatenate p using 0? Just under the last element of p or two 0 before and two 0 behind?
What I really want to know is the exact form of deconvoution in programs. Really Really appraciate it if anyone could help. Please! deconvolution, toeplitz matrix, digital signal processing MATLAB Answers — New Questions
stepper motor control
hi to all,
i am currently doing a project on robotic arm. i have successfully connect and run my motor through serial port. but now i need to control the robotic arm to move to a desired position..can someone give me any idea on how to do that??..do i need to control the speed as well??
thanks a lot in advancehi to all,
i am currently doing a project on robotic arm. i have successfully connect and run my motor through serial port. but now i need to control the robotic arm to move to a desired position..can someone give me any idea on how to do that??..do i need to control the speed as well??
thanks a lot in advance hi to all,
i am currently doing a project on robotic arm. i have successfully connect and run my motor through serial port. but now i need to control the robotic arm to move to a desired position..can someone give me any idea on how to do that??..do i need to control the speed as well??
thanks a lot in advance gui, robot, power_electronics_control, electric_motor_control MATLAB Answers — New Questions
the folder AMSimulink.ml not available
After installation of MATLAB i can use connection of MATLAB and Aspentech dynamic
after that not possible due to AMSimulink.ml not availbleAfter installation of MATLAB i can use connection of MATLAB and Aspentech dynamic
after that not possible due to AMSimulink.ml not availble After installation of MATLAB i can use connection of MATLAB and Aspentech dynamic
after that not possible due to AMSimulink.ml not availble amsimulink.ml and matlab aspentch not installed MATLAB Answers — New Questions
Pressure-flow characteristic for a 4-Way Directional Valve
I’ve to parametrize the block "4-Way Directional Valve" in Simscape Fluids by using Pressure-flow characteristic. I’ve read carefully the documentation: https://it.mathworks.com/help/physmod/hydro/ref/4waydirectionalvalve.html, but unfortunately not everything is clear. In particular the pressure differential vector is not well defined (what positive pressure or negative pressure means?) and the same for the volumetric flow. Assuming positive pressure drop from A to P and positive flow from P to A I’ve used the following parameter, but I’m note sure it’s right, someone could confirm?
x= [0,2,4,6,8,10]; %mm, spool position
P=[5,50,315]; %pressure vector bar
q5b= [0,0, 4, 14,31,58]; %liters/minute at 5 bar
q50b=[0,0, 8, 20,35,58]; %liters/minute at 50 bar
q315b=[0,0, 13, 23,33,40]; %liters/minute at 315 bar
M=[q5b’ q50b’ q315b’]; %volumetric flow rate tableI’ve to parametrize the block "4-Way Directional Valve" in Simscape Fluids by using Pressure-flow characteristic. I’ve read carefully the documentation: https://it.mathworks.com/help/physmod/hydro/ref/4waydirectionalvalve.html, but unfortunately not everything is clear. In particular the pressure differential vector is not well defined (what positive pressure or negative pressure means?) and the same for the volumetric flow. Assuming positive pressure drop from A to P and positive flow from P to A I’ve used the following parameter, but I’m note sure it’s right, someone could confirm?
x= [0,2,4,6,8,10]; %mm, spool position
P=[5,50,315]; %pressure vector bar
q5b= [0,0, 4, 14,31,58]; %liters/minute at 5 bar
q50b=[0,0, 8, 20,35,58]; %liters/minute at 50 bar
q315b=[0,0, 13, 23,33,40]; %liters/minute at 315 bar
M=[q5b’ q50b’ q315b’]; %volumetric flow rate table I’ve to parametrize the block "4-Way Directional Valve" in Simscape Fluids by using Pressure-flow characteristic. I’ve read carefully the documentation: https://it.mathworks.com/help/physmod/hydro/ref/4waydirectionalvalve.html, but unfortunately not everything is clear. In particular the pressure differential vector is not well defined (what positive pressure or negative pressure means?) and the same for the volumetric flow. Assuming positive pressure drop from A to P and positive flow from P to A I’ve used the following parameter, but I’m note sure it’s right, someone could confirm?
x= [0,2,4,6,8,10]; %mm, spool position
P=[5,50,315]; %pressure vector bar
q5b= [0,0, 4, 14,31,58]; %liters/minute at 5 bar
q50b=[0,0, 8, 20,35,58]; %liters/minute at 50 bar
q315b=[0,0, 13, 23,33,40]; %liters/minute at 315 bar
M=[q5b’ q50b’ q315b’]; %volumetric flow rate table 4-way directional valve MATLAB Answers — New Questions
reinforcement learning toolbox. error: Error encountered while creating actor representation: Observation names must match the names of the deep neural network’s input layers.
Error encountered while creating actor representation:
Observation names must match the names of the deep neural network’s input layers. Make sure all observation names appear in the neural network.
My code
% Clear workspace, command window, and close all figures
clear all; clc; close all;
% Define State and Action Dimensions
stateDim = 5; % State dimension
actionDim = 3; % Action dimension
% Create Observation and Action Specifications
ObservationInfo = rlNumericSpec([stateDim 1]);
ObservationInfo.Name = "state";
ActionInfo = rlNumericSpec([actionDim 1], ‘LowerLimit’, [-1; -1; -1], ‘UpperLimit’, [1; 1; 1]);
ActionInfo.Name = "action";
% Display the properties to ensure consistency
disp(ObservationInfo);
disp(ActionInfo);
% Create the environment with the step and reset functions
try
env = rlFunctionEnv(ObservationInfo, ActionInfo, @stepFunction, @resetFunction);
catch ME
disp(‘Error setting up environment:’);
disp(ME.message);
return;
end
% Create a minimal critic network
criticNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(1, ‘Name’, ‘output’)];
% Create a minimal actor network
actorNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(actionDim, ‘Name’, ‘output’)];
% Display layer names for verification
disp([‘Critic Network Input Layer Name: ‘, criticNetwork(1).Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
% Attempt to create the actor and critic representations
try
critic = rlValueFunction(layerGraph(criticNetwork), ObservationInfo);
actor = rlStochasticActorRepresentation(layerGraph(actorNetwork), ObservationInfo, ActionInfo);
catch ME
disp(‘Error encountered while creating actor representation:’);
disp(ME.message);
disp(‘Observation Info and Actor Network Input Layer Names:’);
disp([‘ObservationInfo Name: ‘, ObservationInfo.Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
return; % Stop execution if there’s a mismatch error
end
% Create the PPO agent and specify agent options
agentOptions = rlPPOAgentOptions(‘ClipFactor’, 0.2, ‘EntropyLossWeight’, 0.01, …
‘SampleTime’, 0.1, ‘MiniBatchSize’, 64, ‘ExperienceHorizon’, 128);
agent = rlPPOAgent(actor, critic, agentOptions);
% Specify training options and run training
trainOpts = rlTrainingOptions(‘MaxEpisodes’, 1000, ‘MaxStepsPerEpisode’, 500, …
‘Verbose’, true, ‘Plots’, ‘training-progress’, ‘StopTrainingCriteria’, ‘AverageReward’, …
‘StopTrainingValue’, 500);
trainingStats = train(agent, env, trainOpts);
% Custom reset function to initialize the environment
function [initialObs, loggedSignals] = resetFunction()
stateDim = 5;
initialObs = randn(stateDim, 1);
loggedSignals.State = initialObs;
end
% Custom step function to define environment behavior
function [nextObs, reward, isDone, loggedSignals] = stepFunction(action, loggedSignals)
state = loggedSignals.State;
nextObs = state + [0.1 * action; zeros(2, 1)];
reward = -sum((nextObs(1:3) – action).^2);
isDone = any(abs(nextObs(1:3)) > 10);
loggedSignals.State = nextObs;
endError encountered while creating actor representation:
Observation names must match the names of the deep neural network’s input layers. Make sure all observation names appear in the neural network.
My code
% Clear workspace, command window, and close all figures
clear all; clc; close all;
% Define State and Action Dimensions
stateDim = 5; % State dimension
actionDim = 3; % Action dimension
% Create Observation and Action Specifications
ObservationInfo = rlNumericSpec([stateDim 1]);
ObservationInfo.Name = "state";
ActionInfo = rlNumericSpec([actionDim 1], ‘LowerLimit’, [-1; -1; -1], ‘UpperLimit’, [1; 1; 1]);
ActionInfo.Name = "action";
% Display the properties to ensure consistency
disp(ObservationInfo);
disp(ActionInfo);
% Create the environment with the step and reset functions
try
env = rlFunctionEnv(ObservationInfo, ActionInfo, @stepFunction, @resetFunction);
catch ME
disp(‘Error setting up environment:’);
disp(ME.message);
return;
end
% Create a minimal critic network
criticNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(1, ‘Name’, ‘output’)];
% Create a minimal actor network
actorNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(actionDim, ‘Name’, ‘output’)];
% Display layer names for verification
disp([‘Critic Network Input Layer Name: ‘, criticNetwork(1).Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
% Attempt to create the actor and critic representations
try
critic = rlValueFunction(layerGraph(criticNetwork), ObservationInfo);
actor = rlStochasticActorRepresentation(layerGraph(actorNetwork), ObservationInfo, ActionInfo);
catch ME
disp(‘Error encountered while creating actor representation:’);
disp(ME.message);
disp(‘Observation Info and Actor Network Input Layer Names:’);
disp([‘ObservationInfo Name: ‘, ObservationInfo.Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
return; % Stop execution if there’s a mismatch error
end
% Create the PPO agent and specify agent options
agentOptions = rlPPOAgentOptions(‘ClipFactor’, 0.2, ‘EntropyLossWeight’, 0.01, …
‘SampleTime’, 0.1, ‘MiniBatchSize’, 64, ‘ExperienceHorizon’, 128);
agent = rlPPOAgent(actor, critic, agentOptions);
% Specify training options and run training
trainOpts = rlTrainingOptions(‘MaxEpisodes’, 1000, ‘MaxStepsPerEpisode’, 500, …
‘Verbose’, true, ‘Plots’, ‘training-progress’, ‘StopTrainingCriteria’, ‘AverageReward’, …
‘StopTrainingValue’, 500);
trainingStats = train(agent, env, trainOpts);
% Custom reset function to initialize the environment
function [initialObs, loggedSignals] = resetFunction()
stateDim = 5;
initialObs = randn(stateDim, 1);
loggedSignals.State = initialObs;
end
% Custom step function to define environment behavior
function [nextObs, reward, isDone, loggedSignals] = stepFunction(action, loggedSignals)
state = loggedSignals.State;
nextObs = state + [0.1 * action; zeros(2, 1)];
reward = -sum((nextObs(1:3) – action).^2);
isDone = any(abs(nextObs(1:3)) > 10);
loggedSignals.State = nextObs;
end Error encountered while creating actor representation:
Observation names must match the names of the deep neural network’s input layers. Make sure all observation names appear in the neural network.
My code
% Clear workspace, command window, and close all figures
clear all; clc; close all;
% Define State and Action Dimensions
stateDim = 5; % State dimension
actionDim = 3; % Action dimension
% Create Observation and Action Specifications
ObservationInfo = rlNumericSpec([stateDim 1]);
ObservationInfo.Name = "state";
ActionInfo = rlNumericSpec([actionDim 1], ‘LowerLimit’, [-1; -1; -1], ‘UpperLimit’, [1; 1; 1]);
ActionInfo.Name = "action";
% Display the properties to ensure consistency
disp(ObservationInfo);
disp(ActionInfo);
% Create the environment with the step and reset functions
try
env = rlFunctionEnv(ObservationInfo, ActionInfo, @stepFunction, @resetFunction);
catch ME
disp(‘Error setting up environment:’);
disp(ME.message);
return;
end
% Create a minimal critic network
criticNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(1, ‘Name’, ‘output’)];
% Create a minimal actor network
actorNetwork = [
featureInputLayer(stateDim, ‘Normalization’, ‘none’, ‘Name’, ‘state’)
fullyConnectedLayer(actionDim, ‘Name’, ‘output’)];
% Display layer names for verification
disp([‘Critic Network Input Layer Name: ‘, criticNetwork(1).Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
% Attempt to create the actor and critic representations
try
critic = rlValueFunction(layerGraph(criticNetwork), ObservationInfo);
actor = rlStochasticActorRepresentation(layerGraph(actorNetwork), ObservationInfo, ActionInfo);
catch ME
disp(‘Error encountered while creating actor representation:’);
disp(ME.message);
disp(‘Observation Info and Actor Network Input Layer Names:’);
disp([‘ObservationInfo Name: ‘, ObservationInfo.Name]);
disp([‘Actor Network Input Layer Name: ‘, actorNetwork(1).Name]);
return; % Stop execution if there’s a mismatch error
end
% Create the PPO agent and specify agent options
agentOptions = rlPPOAgentOptions(‘ClipFactor’, 0.2, ‘EntropyLossWeight’, 0.01, …
‘SampleTime’, 0.1, ‘MiniBatchSize’, 64, ‘ExperienceHorizon’, 128);
agent = rlPPOAgent(actor, critic, agentOptions);
% Specify training options and run training
trainOpts = rlTrainingOptions(‘MaxEpisodes’, 1000, ‘MaxStepsPerEpisode’, 500, …
‘Verbose’, true, ‘Plots’, ‘training-progress’, ‘StopTrainingCriteria’, ‘AverageReward’, …
‘StopTrainingValue’, 500);
trainingStats = train(agent, env, trainOpts);
% Custom reset function to initialize the environment
function [initialObs, loggedSignals] = resetFunction()
stateDim = 5;
initialObs = randn(stateDim, 1);
loggedSignals.State = initialObs;
end
% Custom step function to define environment behavior
function [nextObs, reward, isDone, loggedSignals] = stepFunction(action, loggedSignals)
state = loggedSignals.State;
nextObs = state + [0.1 * action; zeros(2, 1)];
reward = -sum((nextObs(1:3) – action).^2);
isDone = any(abs(nextObs(1:3)) > 10);
loggedSignals.State = nextObs;
end reinforced learning, observation names, deep neural network’s input layers. MATLAB Answers — New Questions
What types of components should be connected to the interfaces of the fault(three-phase) module?
What components should be connected to the external trigger of the faulty (three-phase) module? I think it should be input control signals, such as step modules, PWM modules, or signal generators. But the interface of the faulty module is triangular, and none of the above matches and cannot be connected. Should I choose other modules? How do I still need to convert it? Another interface is the three-phase composite interface, which directly includes the ABC three-phase, which makes it impossible for me to connect this faulty module to my three-phase circuit. Even if I tried to combine the three phases with mux, I couldn’t connect to the symbol interface. Can this interface only connect components such as programmable voltage sources that are also three-phase composite interfaces?What components should be connected to the external trigger of the faulty (three-phase) module? I think it should be input control signals, such as step modules, PWM modules, or signal generators. But the interface of the faulty module is triangular, and none of the above matches and cannot be connected. Should I choose other modules? How do I still need to convert it? Another interface is the three-phase composite interface, which directly includes the ABC three-phase, which makes it impossible for me to connect this faulty module to my three-phase circuit. Even if I tried to combine the three phases with mux, I couldn’t connect to the symbol interface. Can this interface only connect components such as programmable voltage sources that are also three-phase composite interfaces? What components should be connected to the external trigger of the faulty (three-phase) module? I think it should be input control signals, such as step modules, PWM modules, or signal generators. But the interface of the faulty module is triangular, and none of the above matches and cannot be connected. Should I choose other modules? How do I still need to convert it? Another interface is the three-phase composite interface, which directly includes the ABC three-phase, which makes it impossible for me to connect this faulty module to my three-phase circuit. Even if I tried to combine the three phases with mux, I couldn’t connect to the symbol interface. Can this interface only connect components such as programmable voltage sources that are also three-phase composite interfaces? simulink, signal MATLAB Answers — New Questions
Multiply two probability plots (CDF/PDF)
I have two probability plots, one generated as a CDF, and one as a pdf. The exact mathematics is not important for my purpose, I only want to extract the qualitative idea.
This is the code I used:
figure()
ax1 = subplot(1,1,1);
cdfplot(temp);
% plot(DE,y)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
figure();
pd_HOLT = fitdist(total_HOLT,’Normal’);
DE_HOLT = bingroups_HOLT;
y_HOLT = pdf(pd_HOLT,DE_HOLT);
ax1 = subplot(1,1,1);
plot(DE_HOLT,y_HOLT)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
The x-axis is the same. How can I multiply these plots to convey a (qualitative) idea? Thanks.I have two probability plots, one generated as a CDF, and one as a pdf. The exact mathematics is not important for my purpose, I only want to extract the qualitative idea.
This is the code I used:
figure()
ax1 = subplot(1,1,1);
cdfplot(temp);
% plot(DE,y)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
figure();
pd_HOLT = fitdist(total_HOLT,’Normal’);
DE_HOLT = bingroups_HOLT;
y_HOLT = pdf(pd_HOLT,DE_HOLT);
ax1 = subplot(1,1,1);
plot(DE_HOLT,y_HOLT)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
The x-axis is the same. How can I multiply these plots to convey a (qualitative) idea? Thanks. I have two probability plots, one generated as a CDF, and one as a pdf. The exact mathematics is not important for my purpose, I only want to extract the qualitative idea.
This is the code I used:
figure()
ax1 = subplot(1,1,1);
cdfplot(temp);
% plot(DE,y)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
figure();
pd_HOLT = fitdist(total_HOLT,’Normal’);
DE_HOLT = bingroups_HOLT;
y_HOLT = pdf(pd_HOLT,DE_HOLT);
ax1 = subplot(1,1,1);
plot(DE_HOLT,y_HOLT)
ax1.XDir = ‘reverse’;
set(gca, ‘YScale’, ‘log’)
The x-axis is the same. How can I multiply these plots to convey a (qualitative) idea? Thanks. probability, distribution, multiply MATLAB Answers — New Questions