Tag Archives: matlab
How does the regionprops calculate the area or the eccentricity of an object?
Hi,
I have been reading a lot about image segmentation lately and know that some algorithms are based on the region and some are based on the boundary of a pixel.
I am wondering now how the regionprops function in MATLAB calculates the properties of an object and if there is any proper reference paper on the function to learn how the alogrithm of the regionprops work?
With regionprops () circles can be found by calculating the eccentricity or the roundness of an object. Another method is the Hough Transform to detect lines and circles.
What are the advantages for regionprops in comparison to the Hough Transform?Hi,
I have been reading a lot about image segmentation lately and know that some algorithms are based on the region and some are based on the boundary of a pixel.
I am wondering now how the regionprops function in MATLAB calculates the properties of an object and if there is any proper reference paper on the function to learn how the alogrithm of the regionprops work?
With regionprops () circles can be found by calculating the eccentricity or the roundness of an object. Another method is the Hough Transform to detect lines and circles.
What are the advantages for regionprops in comparison to the Hough Transform? Hi,
I have been reading a lot about image segmentation lately and know that some algorithms are based on the region and some are based on the boundary of a pixel.
I am wondering now how the regionprops function in MATLAB calculates the properties of an object and if there is any proper reference paper on the function to learn how the alogrithm of the regionprops work?
With regionprops () circles can be found by calculating the eccentricity or the roundness of an object. Another method is the Hough Transform to detect lines and circles.
What are the advantages for regionprops in comparison to the Hough Transform? image analysis, image processing, regionprops, ellipse, eccentricity MATLAB Answers — New Questions
Trying to understand why my graphs are all flipped
My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
clc;
clear;
%Variables
m=15;
k = 15;
a_anode = 0.54; %transfer coefficient at anode
a_cathode = 0.52; %transfer coeffiecent at cathode
R = 8.314;%Gas constant
F = 96485;%Faraday constant
T = 300; %Temperature of cell
A_electrodes = 2; %area of electrodes
R_in = A_electrodes*2.5; %Internal resistance of the cell
n_anode = 2; %moles per reactant at the anode
n_cathode =4;%moles per reactant at the cathode
D_anode = 2.4e-6; %diffusion coefficient of glucose in bird
D_cathode = 1.8e-5;%diffusion coefficient of oxygen in bird
d_l_a = 0.005; %diffsuion layer thickness anode
d_l_c= 0.005 ;%diffsuion layer thickness cathode
j = linspace(0.0e-3,0.7e-3,k);%Current density of the cell
jT = j’;
C_s_anode = 5.55e-8; %concentration of reactant at the catalyst
C_s_cathode = 1.71e-8; %concentration of reactant at the catalyst
A_anode = 2; %active area of electrode
A_cathode = 2; %active area of electrode
row = 0.005; %diffusion distance
e = 0.4;%porosity of the structure
D_ij_anode = 9.5e-6; %binary diffusion coefficient(glucose in human dura mater)
D_ij_cathode = 1.8e-5;%Diffsuion coefficent of oxyegen in plain medium
i_ref_a = 3.5e-3; %anode reference exchange current density
L_anode = 0.3; %catalyst loading anode
P_anode = 2130; %Pressure at anode
P_ref_anode = 1.2; %reference pressure at the anode
T_ref_anode = 298; %reference temperature at anode
i_ref_c = 1.95e5; %anode reference exchange current density
L_cathode = 0.3; %catalyst loading anode
P_cathode = 50; %Pressure at anode
P_ref_cathode = 700; %reference pressure at the anode
T_ref_cathode = 298; %reference temperature at anode
%————————————————————————–
%Effective exchange current density
%Anode
i0_a = i_ref_a * A_anode * L_anode *(P_anode/P_ref_anode)^0.5 *(-(130/R*T)*(1-(T/T_ref_anode)));
%Cathode
i0_c = i_ref_c * A_cathode * L_cathode *(P_cathode/P_ref_cathode)^1 *(-(66/R*T)*(1-(T/T_ref_cathode)));
%————————————————————————–
%Activation Overpotential
%Anode
V_act_a = (R*T)/(a_anode*n_anode*F)*log(j/i0_a);%activation potential at anode
V_act_anode = abs(V_act_a);
display(V_act_anode)
%Cathode
V_act_c = (R*T)/(a_cathode*n_cathode*F)*log(j/i0_c);%activation potential at cathode
V_act_cathode = abs(V_act_c);
display(V_act_cathode)
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
%J-V curve
figure
plot(j,V_act)
title(‘J-V Vact curve’)
xlabel(‘Current density’)
ylabel(‘Activation overpotential’)
%————————————————————————–
%Ohmic overpotential
%R_cell_anode = Rin .* A_anode; %resisitance of fuel cell
%R_cell_cathode = Rin .* A_cathode; %resisitance of fuel cell
%R_cell = R_cell_anode + R_cell_cathode;
V_ohm = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(n_anode*F);%diffusion flux of reactants
display(J_diff_anode)
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
C_b_anode = -((J_diff_anode*row)/-D_eff_anode)+ C_s_anode;
C_b_anodeT = C_b_anode’;
Glucose_conc = (C_b_anodeT * 180.156)*100000;
%Cathode
J_diff_cathode = j/(n_cathode*F);%diffusion flux of reactants
display(J_diff_cathode)
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
%————————————————————————–
%Concentration overpotential
%limiting current at anode
i_L_a = (n_anode*F*D_eff_anode*C_b_anode)/d_l_a;
%limiting current at cathode
i_L_c = (n_cathode*F*D_eff_cathode*C_b_cathode)/d_l_c;
%concentration overpotential at anode
V_conc_anode = (R*T)/(n_anode*F)*log(i_L_a./(i_L_a-j));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,V_conc)
title(‘J-V Vconc curve’)
xlabel(‘Current density’)
ylabel(‘Cocnetration overpotential’)
%————————————————————————–
%Cell potential
Et =1.3; %thermodynamic potential of fuel cell
%Fuel cell voltage
V_cell1 = Et – V_act – V_conc – V_ohm;
V_cell = abs(V_cell1);
%————————————————————————–
%Power of fuel cell
P_cell = V_cell .* j;
P_cell1 = abs(P_cell);
%————————————————————————–
%J-V curve
figure
plot(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’)My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
clc;
clear;
%Variables
m=15;
k = 15;
a_anode = 0.54; %transfer coefficient at anode
a_cathode = 0.52; %transfer coeffiecent at cathode
R = 8.314;%Gas constant
F = 96485;%Faraday constant
T = 300; %Temperature of cell
A_electrodes = 2; %area of electrodes
R_in = A_electrodes*2.5; %Internal resistance of the cell
n_anode = 2; %moles per reactant at the anode
n_cathode =4;%moles per reactant at the cathode
D_anode = 2.4e-6; %diffusion coefficient of glucose in bird
D_cathode = 1.8e-5;%diffusion coefficient of oxygen in bird
d_l_a = 0.005; %diffsuion layer thickness anode
d_l_c= 0.005 ;%diffsuion layer thickness cathode
j = linspace(0.0e-3,0.7e-3,k);%Current density of the cell
jT = j’;
C_s_anode = 5.55e-8; %concentration of reactant at the catalyst
C_s_cathode = 1.71e-8; %concentration of reactant at the catalyst
A_anode = 2; %active area of electrode
A_cathode = 2; %active area of electrode
row = 0.005; %diffusion distance
e = 0.4;%porosity of the structure
D_ij_anode = 9.5e-6; %binary diffusion coefficient(glucose in human dura mater)
D_ij_cathode = 1.8e-5;%Diffsuion coefficent of oxyegen in plain medium
i_ref_a = 3.5e-3; %anode reference exchange current density
L_anode = 0.3; %catalyst loading anode
P_anode = 2130; %Pressure at anode
P_ref_anode = 1.2; %reference pressure at the anode
T_ref_anode = 298; %reference temperature at anode
i_ref_c = 1.95e5; %anode reference exchange current density
L_cathode = 0.3; %catalyst loading anode
P_cathode = 50; %Pressure at anode
P_ref_cathode = 700; %reference pressure at the anode
T_ref_cathode = 298; %reference temperature at anode
%————————————————————————–
%Effective exchange current density
%Anode
i0_a = i_ref_a * A_anode * L_anode *(P_anode/P_ref_anode)^0.5 *(-(130/R*T)*(1-(T/T_ref_anode)));
%Cathode
i0_c = i_ref_c * A_cathode * L_cathode *(P_cathode/P_ref_cathode)^1 *(-(66/R*T)*(1-(T/T_ref_cathode)));
%————————————————————————–
%Activation Overpotential
%Anode
V_act_a = (R*T)/(a_anode*n_anode*F)*log(j/i0_a);%activation potential at anode
V_act_anode = abs(V_act_a);
display(V_act_anode)
%Cathode
V_act_c = (R*T)/(a_cathode*n_cathode*F)*log(j/i0_c);%activation potential at cathode
V_act_cathode = abs(V_act_c);
display(V_act_cathode)
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
%J-V curve
figure
plot(j,V_act)
title(‘J-V Vact curve’)
xlabel(‘Current density’)
ylabel(‘Activation overpotential’)
%————————————————————————–
%Ohmic overpotential
%R_cell_anode = Rin .* A_anode; %resisitance of fuel cell
%R_cell_cathode = Rin .* A_cathode; %resisitance of fuel cell
%R_cell = R_cell_anode + R_cell_cathode;
V_ohm = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(n_anode*F);%diffusion flux of reactants
display(J_diff_anode)
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
C_b_anode = -((J_diff_anode*row)/-D_eff_anode)+ C_s_anode;
C_b_anodeT = C_b_anode’;
Glucose_conc = (C_b_anodeT * 180.156)*100000;
%Cathode
J_diff_cathode = j/(n_cathode*F);%diffusion flux of reactants
display(J_diff_cathode)
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
%————————————————————————–
%Concentration overpotential
%limiting current at anode
i_L_a = (n_anode*F*D_eff_anode*C_b_anode)/d_l_a;
%limiting current at cathode
i_L_c = (n_cathode*F*D_eff_cathode*C_b_cathode)/d_l_c;
%concentration overpotential at anode
V_conc_anode = (R*T)/(n_anode*F)*log(i_L_a./(i_L_a-j));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,V_conc)
title(‘J-V Vconc curve’)
xlabel(‘Current density’)
ylabel(‘Cocnetration overpotential’)
%————————————————————————–
%Cell potential
Et =1.3; %thermodynamic potential of fuel cell
%Fuel cell voltage
V_cell1 = Et – V_act – V_conc – V_ohm;
V_cell = abs(V_cell1);
%————————————————————————–
%Power of fuel cell
P_cell = V_cell .* j;
P_cell1 = abs(P_cell);
%————————————————————————–
%J-V curve
figure
plot(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’) My ohmic overpotential curve, concentration overpotential curve and cell j-v curve are suppose to be flipped meaning my voltage is meant to decrease when my current density increases (negative gradient)
clc;
clear;
%Variables
m=15;
k = 15;
a_anode = 0.54; %transfer coefficient at anode
a_cathode = 0.52; %transfer coeffiecent at cathode
R = 8.314;%Gas constant
F = 96485;%Faraday constant
T = 300; %Temperature of cell
A_electrodes = 2; %area of electrodes
R_in = A_electrodes*2.5; %Internal resistance of the cell
n_anode = 2; %moles per reactant at the anode
n_cathode =4;%moles per reactant at the cathode
D_anode = 2.4e-6; %diffusion coefficient of glucose in bird
D_cathode = 1.8e-5;%diffusion coefficient of oxygen in bird
d_l_a = 0.005; %diffsuion layer thickness anode
d_l_c= 0.005 ;%diffsuion layer thickness cathode
j = linspace(0.0e-3,0.7e-3,k);%Current density of the cell
jT = j’;
C_s_anode = 5.55e-8; %concentration of reactant at the catalyst
C_s_cathode = 1.71e-8; %concentration of reactant at the catalyst
A_anode = 2; %active area of electrode
A_cathode = 2; %active area of electrode
row = 0.005; %diffusion distance
e = 0.4;%porosity of the structure
D_ij_anode = 9.5e-6; %binary diffusion coefficient(glucose in human dura mater)
D_ij_cathode = 1.8e-5;%Diffsuion coefficent of oxyegen in plain medium
i_ref_a = 3.5e-3; %anode reference exchange current density
L_anode = 0.3; %catalyst loading anode
P_anode = 2130; %Pressure at anode
P_ref_anode = 1.2; %reference pressure at the anode
T_ref_anode = 298; %reference temperature at anode
i_ref_c = 1.95e5; %anode reference exchange current density
L_cathode = 0.3; %catalyst loading anode
P_cathode = 50; %Pressure at anode
P_ref_cathode = 700; %reference pressure at the anode
T_ref_cathode = 298; %reference temperature at anode
%————————————————————————–
%Effective exchange current density
%Anode
i0_a = i_ref_a * A_anode * L_anode *(P_anode/P_ref_anode)^0.5 *(-(130/R*T)*(1-(T/T_ref_anode)));
%Cathode
i0_c = i_ref_c * A_cathode * L_cathode *(P_cathode/P_ref_cathode)^1 *(-(66/R*T)*(1-(T/T_ref_cathode)));
%————————————————————————–
%Activation Overpotential
%Anode
V_act_a = (R*T)/(a_anode*n_anode*F)*log(j/i0_a);%activation potential at anode
V_act_anode = abs(V_act_a);
display(V_act_anode)
%Cathode
V_act_c = (R*T)/(a_cathode*n_cathode*F)*log(j/i0_c);%activation potential at cathode
V_act_cathode = abs(V_act_c);
display(V_act_cathode)
%Total activation overpotential
V_act = V_act_cathode + V_act_anode;
display(V_act)
%J-V curve
figure
plot(j,V_act)
title(‘J-V Vact curve’)
xlabel(‘Current density’)
ylabel(‘Activation overpotential’)
%————————————————————————–
%Ohmic overpotential
%R_cell_anode = Rin .* A_anode; %resisitance of fuel cell
%R_cell_cathode = Rin .* A_cathode; %resisitance of fuel cell
%R_cell = R_cell_anode + R_cell_cathode;
V_ohm = j .* R_in;%ohmic overpotential of cell
display(V_ohm)
%J-V curve
figure
plot(j,V_ohm)
title(‘J-V ohmic curve’)
xlabel(‘Current density’)
ylabel(‘Ohmic overpotential’)
%————————————————————————–
%Determining glucose concentration
%Anode
J_diff_anode = j/(n_anode*F);%diffusion flux of reactants
display(J_diff_anode)
D_eff_anode = (e^1.5) * D_ij_anode;%effective reactant diffusivity
display(D_eff_anode)
C_b_anode = -((J_diff_anode*row)/-D_eff_anode)+ C_s_anode;
C_b_anodeT = C_b_anode’;
Glucose_conc = (C_b_anodeT * 180.156)*100000;
%Cathode
J_diff_cathode = j/(n_cathode*F);%diffusion flux of reactants
display(J_diff_cathode)
D_eff_cathode = (e^1.5) * D_ij_cathode;%effective reactant diffusivity
display(D_eff_cathode)
C_b_cathode = -((J_diff_cathode*row)/-D_eff_cathode)+ C_s_cathode;
%bulk concentration of reactant(oxygen)
display(C_b_cathode)
%————————————————————————–
%Concentration overpotential
%limiting current at anode
i_L_a = (n_anode*F*D_eff_anode*C_b_anode)/d_l_a;
%limiting current at cathode
i_L_c = (n_cathode*F*D_eff_cathode*C_b_cathode)/d_l_c;
%concentration overpotential at anode
V_conc_anode = (R*T)/(n_anode*F)*log(i_L_a./(i_L_a-j));
%concentration overpotential at cathode
V_conc_cathode = (R*T)/(n_cathode*F)*log(i_L_c./(i_L_c-j));
%concentration overpotential
V_conc =V_conc_cathode + V_conc_anode;
%J-V curve
figure
plot(j,V_conc)
title(‘J-V Vconc curve’)
xlabel(‘Current density’)
ylabel(‘Cocnetration overpotential’)
%————————————————————————–
%Cell potential
Et =1.3; %thermodynamic potential of fuel cell
%Fuel cell voltage
V_cell1 = Et – V_act – V_conc – V_ohm;
V_cell = abs(V_cell1);
%————————————————————————–
%Power of fuel cell
P_cell = V_cell .* j;
P_cell1 = abs(P_cell);
%————————————————————————–
%J-V curve
figure
plot(j,V_cell)
title(‘J-V curve’)
xlabel(‘Current density’)
ylabel(‘Cell voltage’) matlab, fuelcell MATLAB Answers — New Questions
Why doesn’t saving a model change my mask parameter in Simulink?
I have a mask parameter that changes during model update but not during model save in Simulink. Why does this occur?I have a mask parameter that changes during model update but not during model save in Simulink. Why does this occur? I have a mask parameter that changes during model update but not during model save in Simulink. Why does this occur? dirty, callback, model, mask, block, autosar MATLAB Answers — New Questions
Why does the view zoom in and out randomly when I try to rotate around my 3-D image?
Why does the view zoom in and out randomly when I try to rotate around my 3-D image?
I have created a 3-D image and want to rotate my view around the image. As it rotates, the perspective seems to zoom in and out causing an undesired bouncing effect. The following code illustrates this effect:
% This part of the code draws an arbitrary image
figure(‘renderer’,’zbuffer’,’color’,’k’)
[x,y,z]=sphere;
hold on
for j=[-1 1],
patch([-1 -1 1 1],[-1 1 1 -1],[j j j j],’b’)
patch([-1 -1 1 1],[j j j j],[-1 1 1 -1],’r’)
patch([j j j j],[-1 -1 1 1],[-1 1 1 -1],’g’)
surf(x+3*j,y,z)
surf(x,y+3*j,z)
end
axis([-5 5 -6 6 -5 5],’off’)
view(3)
% Get the current view angle
[az,el]=view;
el=el+15;
% Now rotate around the image
for j=10:10:360,
view(az+j,el)
pause(0.1)
end
How can I stabilize the view so that I can rotate the camera smoothly around my image?Why does the view zoom in and out randomly when I try to rotate around my 3-D image?
I have created a 3-D image and want to rotate my view around the image. As it rotates, the perspective seems to zoom in and out causing an undesired bouncing effect. The following code illustrates this effect:
% This part of the code draws an arbitrary image
figure(‘renderer’,’zbuffer’,’color’,’k’)
[x,y,z]=sphere;
hold on
for j=[-1 1],
patch([-1 -1 1 1],[-1 1 1 -1],[j j j j],’b’)
patch([-1 -1 1 1],[j j j j],[-1 1 1 -1],’r’)
patch([j j j j],[-1 -1 1 1],[-1 1 1 -1],’g’)
surf(x+3*j,y,z)
surf(x,y+3*j,z)
end
axis([-5 5 -6 6 -5 5],’off’)
view(3)
% Get the current view angle
[az,el]=view;
el=el+15;
% Now rotate around the image
for j=10:10:360,
view(az+j,el)
pause(0.1)
end
How can I stabilize the view so that I can rotate the camera smoothly around my image? Why does the view zoom in and out randomly when I try to rotate around my 3-D image?
I have created a 3-D image and want to rotate my view around the image. As it rotates, the perspective seems to zoom in and out causing an undesired bouncing effect. The following code illustrates this effect:
% This part of the code draws an arbitrary image
figure(‘renderer’,’zbuffer’,’color’,’k’)
[x,y,z]=sphere;
hold on
for j=[-1 1],
patch([-1 -1 1 1],[-1 1 1 -1],[j j j j],’b’)
patch([-1 -1 1 1],[j j j j],[-1 1 1 -1],’r’)
patch([j j j j],[-1 -1 1 1],[-1 1 1 -1],’g’)
surf(x+3*j,y,z)
surf(x,y+3*j,z)
end
axis([-5 5 -6 6 -5 5],’off’)
view(3)
% Get the current view angle
[az,el]=view;
el=el+15;
% Now rotate around the image
for j=10:10:360,
view(az+j,el)
pause(0.1)
end
How can I stabilize the view so that I can rotate the camera smoothly around my image? rotate, 3d, 3-d, cameraposition, view, angle MATLAB Answers — New Questions
Integers can only be combined with integers of the same class, or scalar doubles
Error using –
Integers can only be combined with integers of the same class, or scalar doubles.
Error in Code (line 27)
data = data – repmat(mn,1,N);
Here is the code snip, where I am subtracting off the mean of some matrices:
mn = mean(data,2);
data = data – repmat(mn,1,N);
I tried casting the new data matrix to an int16 but that gave the same error, not sure what to cast it to, to avoid error.Error using –
Integers can only be combined with integers of the same class, or scalar doubles.
Error in Code (line 27)
data = data – repmat(mn,1,N);
Here is the code snip, where I am subtracting off the mean of some matrices:
mn = mean(data,2);
data = data – repmat(mn,1,N);
I tried casting the new data matrix to an int16 but that gave the same error, not sure what to cast it to, to avoid error. Error using –
Integers can only be combined with integers of the same class, or scalar doubles.
Error in Code (line 27)
data = data – repmat(mn,1,N);
Here is the code snip, where I am subtracting off the mean of some matrices:
mn = mean(data,2);
data = data – repmat(mn,1,N);
I tried casting the new data matrix to an int16 but that gave the same error, not sure what to cast it to, to avoid error. image processing, image analysis, code MATLAB Answers — New Questions
Method for Measuring Forces Due to Mass in 6 Degrees of Freedom Motion
Hello, I am currently conducting research on the control of a Stewart platform. I am planning to add a mass of a certain weight to the upper platform and measure the forces acting on the upper plate due to the motion. However, I am unsure about which sensors to use for this purpose. I would greatly appreciate any advice you can provide.
The mass will be added to the corners of the upper platform.
I found the Ideal Force Sensor block, but there are no examples of how to use it. I would appreciate it if you could also explain how to use this block.Hello, I am currently conducting research on the control of a Stewart platform. I am planning to add a mass of a certain weight to the upper platform and measure the forces acting on the upper plate due to the motion. However, I am unsure about which sensors to use for this purpose. I would greatly appreciate any advice you can provide.
The mass will be added to the corners of the upper platform.
I found the Ideal Force Sensor block, but there are no examples of how to use it. I would appreciate it if you could also explain how to use this block. Hello, I am currently conducting research on the control of a Stewart platform. I am planning to add a mass of a certain weight to the upper platform and measure the forces acting on the upper plate due to the motion. However, I am unsure about which sensors to use for this purpose. I would greatly appreciate any advice you can provide.
The mass will be added to the corners of the upper platform.
I found the Ideal Force Sensor block, but there are no examples of how to use it. I would appreciate it if you could also explain how to use this block. simulink, simscape MATLAB Answers — New Questions
Adjusting color limits on displayed color images
When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white.When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white. When displaying a color image is it possible to set the limits of the cData. The below dcoumentation states that if a double is given then the limits range from 0 to 1 with different values for int8 etc.
Is it possible to change what these limits are, ideally with different values for each channel. Currently my solution is to scale the origional data before senging it to image(), but this is slow to do each time the user wants to adjust these scale values to highlight different parts of the data. It also prevents tools like impixelinfo from giving correct values. Also if there are any other features that are plotted such as boxes then these also need to be redone. Zoom ranges and everything else also need to be preserved. This all becomes a big hassle and affects performance if the user is regulary changing the intensity scales.
How are these limits set? CLim seems to have no effect, neither do the colormaps.
Is it possible to set the black and white values of a displayed image through some undocumented feature?
Cheers Alaster
3-D array of RGB triplets — This format defines true color image data using RGB triplet values. Each RGB triplet defines a color for one pixel of the image. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of the color. The first page of the 3-D array contains the red components, the second page contains the green components, and the third page contains the blue components. Since the image uses true colors instead of colormap colors, the CDataMapping property has no effect.
If CData is of type double, then an RGB triplet value of [0 0 0] corresponds to black and [1 1 1] corresponds to white.
If CData is an integer type, then the image uses the full range of data to determine the color. For example, if CData is of type uint8, then [0 0 0] corresponds to black and [255 255 255] corresponds to white. If CData is of type int8, then [-128 -128 -128] corresponds to black and [127 127 127] corresponds to white.
If CData is of type logical, then [0 0 0] corresponds to black and [1 1 1] corresponds to white. imagesc, clim, cdata, colormap, impixelinfo, image MATLAB Answers — New Questions
Error in displaying the whole matrix
Hello,
When I try to display the whole matrix I receive the data in the following shape:
-0.0008 0.0001 0.0000
-0.0005 0.0001 0.0000
-0.0004 0.0001 0.0000
-0.0002 0.0001 0.0000
-0.0000 0.0001 0.0000
However when I attempt to display the portion of matrix teh result is correct:
-823 8 1
-584 8 1
-409 8 1
-304.928530000000 8 1
-298.500000000000 8 1
-300.750000000000 8 1
The content of the workspace variable is correct.
The code responsible for this is as follows:
filename = {‘Alessandra’ ‘Alfredo’};
dataConditionDevice = [];
for ifile=1:1%length(filename)
filename{ifile}
filenameEditedTxt = fullfile(pathDataActivityDevice,[filename{ifile},’_trial_data.txt’])
dataConditionDevice = load(filenameEditedTxt);
end
RegardsHello,
When I try to display the whole matrix I receive the data in the following shape:
-0.0008 0.0001 0.0000
-0.0005 0.0001 0.0000
-0.0004 0.0001 0.0000
-0.0002 0.0001 0.0000
-0.0000 0.0001 0.0000
However when I attempt to display the portion of matrix teh result is correct:
-823 8 1
-584 8 1
-409 8 1
-304.928530000000 8 1
-298.500000000000 8 1
-300.750000000000 8 1
The content of the workspace variable is correct.
The code responsible for this is as follows:
filename = {‘Alessandra’ ‘Alfredo’};
dataConditionDevice = [];
for ifile=1:1%length(filename)
filename{ifile}
filenameEditedTxt = fullfile(pathDataActivityDevice,[filename{ifile},’_trial_data.txt’])
dataConditionDevice = load(filenameEditedTxt);
end
Regards Hello,
When I try to display the whole matrix I receive the data in the following shape:
-0.0008 0.0001 0.0000
-0.0005 0.0001 0.0000
-0.0004 0.0001 0.0000
-0.0002 0.0001 0.0000
-0.0000 0.0001 0.0000
However when I attempt to display the portion of matrix teh result is correct:
-823 8 1
-584 8 1
-409 8 1
-304.928530000000 8 1
-298.500000000000 8 1
-300.750000000000 8 1
The content of the workspace variable is correct.
The code responsible for this is as follows:
filename = {‘Alessandra’ ‘Alfredo’};
dataConditionDevice = [];
for ifile=1:1%length(filename)
filename{ifile}
filenameEditedTxt = fullfile(pathDataActivityDevice,[filename{ifile},’_trial_data.txt’])
dataConditionDevice = load(filenameEditedTxt);
end
Regards portion of matrix MATLAB Answers — New Questions
When does an ODE integrator reach the best numerical accuracy?
I’m using an ODE Matlab integrator (Bulirsch-Stoer) that is (supposedly, I never used it before) quite good for solving ODEs with high accuracy. I’m using it to solve highly non-linear diff. eqs. of which one does not know the true solution and which are highly senstivie to initial conditions and numerical accuracy. To be sure that it does the right thing I integrate the curves back and forth and see whether the back-integration returns to the intial conditions. It does. Of course, if the time interval (the ODE’s time-parameter "t") is large enough one sees it diverging (i.e., it doesn’t return to the intital conditions.) This is normal, and expected. However, since the integrator’s accuracy also depends on three independent parameters (the error tolerance, and two internal loops, midpoint and nr. of segmentation points) and it is difficult to find the optimal setting in a large 3D parameter space, I’m wondering whether the divergence from a true solution at some time, say t_max, beyond which the integrator no longer funrishes the correct values, is due to a non-optimal setting of the accuracy parameters (that is, I could still increase the accuracy), or wheteher it has reached the precision that is limited by the internal 15 digits number representation (that is, I reached the max. accuracy, and can’t do anything about it as long I work with double precision.)
So, my question is: Is there a method to know when one has effectively reached the best numerical evaluation in solving an ODE inside the limitation of a double precision integratioon? A method that essentially tells me: "Yes, that’s the best integration, beyond which you can’t go with a 15 digits internal representation, no matter how you fine-tune your solver."
I hope that I expressed clearly what my issue is. Feel free to ask for more information.I’m using an ODE Matlab integrator (Bulirsch-Stoer) that is (supposedly, I never used it before) quite good for solving ODEs with high accuracy. I’m using it to solve highly non-linear diff. eqs. of which one does not know the true solution and which are highly senstivie to initial conditions and numerical accuracy. To be sure that it does the right thing I integrate the curves back and forth and see whether the back-integration returns to the intial conditions. It does. Of course, if the time interval (the ODE’s time-parameter "t") is large enough one sees it diverging (i.e., it doesn’t return to the intital conditions.) This is normal, and expected. However, since the integrator’s accuracy also depends on three independent parameters (the error tolerance, and two internal loops, midpoint and nr. of segmentation points) and it is difficult to find the optimal setting in a large 3D parameter space, I’m wondering whether the divergence from a true solution at some time, say t_max, beyond which the integrator no longer funrishes the correct values, is due to a non-optimal setting of the accuracy parameters (that is, I could still increase the accuracy), or wheteher it has reached the precision that is limited by the internal 15 digits number representation (that is, I reached the max. accuracy, and can’t do anything about it as long I work with double precision.)
So, my question is: Is there a method to know when one has effectively reached the best numerical evaluation in solving an ODE inside the limitation of a double precision integratioon? A method that essentially tells me: "Yes, that’s the best integration, beyond which you can’t go with a 15 digits internal representation, no matter how you fine-tune your solver."
I hope that I expressed clearly what my issue is. Feel free to ask for more information. I’m using an ODE Matlab integrator (Bulirsch-Stoer) that is (supposedly, I never used it before) quite good for solving ODEs with high accuracy. I’m using it to solve highly non-linear diff. eqs. of which one does not know the true solution and which are highly senstivie to initial conditions and numerical accuracy. To be sure that it does the right thing I integrate the curves back and forth and see whether the back-integration returns to the intial conditions. It does. Of course, if the time interval (the ODE’s time-parameter "t") is large enough one sees it diverging (i.e., it doesn’t return to the intital conditions.) This is normal, and expected. However, since the integrator’s accuracy also depends on three independent parameters (the error tolerance, and two internal loops, midpoint and nr. of segmentation points) and it is difficult to find the optimal setting in a large 3D parameter space, I’m wondering whether the divergence from a true solution at some time, say t_max, beyond which the integrator no longer funrishes the correct values, is due to a non-optimal setting of the accuracy parameters (that is, I could still increase the accuracy), or wheteher it has reached the precision that is limited by the internal 15 digits number representation (that is, I reached the max. accuracy, and can’t do anything about it as long I work with double precision.)
So, my question is: Is there a method to know when one has effectively reached the best numerical evaluation in solving an ODE inside the limitation of a double precision integratioon? A method that essentially tells me: "Yes, that’s the best integration, beyond which you can’t go with a 15 digits internal representation, no matter how you fine-tune your solver."
I hope that I expressed clearly what my issue is. Feel free to ask for more information. ode, numerical integration MATLAB Answers — New Questions
Save Live Script automatically as PDF
Hello everyone,
I have a problem!
I wrote a program for the calculation of test data in the App Designer. The test results of the test person should be given to them in a report. Since I do not have access to the report generator, I have compiled the results in a live script and output them. I have set the button on the right to "hide code" and to save I press "save" and then "export to pdf".
Since I would like to compile the program as a standalone program, I cannot press the buttons myself and save the live script as a PDF.
I already tried the following:
matlab.internal.liveeditor.executeAndSave (which (‘Handout.mlx’));
matlab.internal.liveeditor.openAndConvert (‘Handout.mlx’, ‘test.pdf’);
Unfortunately, the code is always displayed there! But the design fits 🙂
Is there another way to automatically save the LiveScript as PDF without code?Hello everyone,
I have a problem!
I wrote a program for the calculation of test data in the App Designer. The test results of the test person should be given to them in a report. Since I do not have access to the report generator, I have compiled the results in a live script and output them. I have set the button on the right to "hide code" and to save I press "save" and then "export to pdf".
Since I would like to compile the program as a standalone program, I cannot press the buttons myself and save the live script as a PDF.
I already tried the following:
matlab.internal.liveeditor.executeAndSave (which (‘Handout.mlx’));
matlab.internal.liveeditor.openAndConvert (‘Handout.mlx’, ‘test.pdf’);
Unfortunately, the code is always displayed there! But the design fits 🙂
Is there another way to automatically save the LiveScript as PDF without code? Hello everyone,
I have a problem!
I wrote a program for the calculation of test data in the App Designer. The test results of the test person should be given to them in a report. Since I do not have access to the report generator, I have compiled the results in a live script and output them. I have set the button on the right to "hide code" and to save I press "save" and then "export to pdf".
Since I would like to compile the program as a standalone program, I cannot press the buttons myself and save the live script as a PDF.
I already tried the following:
matlab.internal.liveeditor.executeAndSave (which (‘Handout.mlx’));
matlab.internal.liveeditor.openAndConvert (‘Handout.mlx’, ‘test.pdf’);
Unfortunately, the code is always displayed there! But the design fits 🙂
Is there another way to automatically save the LiveScript as PDF without code? live script MATLAB Answers — New Questions
Why do I get ” Unable to resolve the name Mdl1b.Partition”
I keep getting "Unable to resolve the name Mdl1b.Partition" everytime I read all lines of the Excel file (1000 lines) but when I limit the lines to read to 50 or so it works perfectly. I do not know why doesn’t matlab read all the lines? is there a limit to the lines matlab reads?
%reading and defining X and Y
datmi=xlsread(‘Significant desc.xlsx’);
X=datmi(2:100,4:51);
Y=datmi (2:100,2);
%deviding the result data to train and test to draw graphs (which causes the error only when reading all the lines)
cvp=Mdl1b.Partition
The error I get
Error in ploting_ruselt (line 1)
cvp=Mdl1b.Partition
Error in ssvm (line 44)
ploting_ruseltI keep getting "Unable to resolve the name Mdl1b.Partition" everytime I read all lines of the Excel file (1000 lines) but when I limit the lines to read to 50 or so it works perfectly. I do not know why doesn’t matlab read all the lines? is there a limit to the lines matlab reads?
%reading and defining X and Y
datmi=xlsread(‘Significant desc.xlsx’);
X=datmi(2:100,4:51);
Y=datmi (2:100,2);
%deviding the result data to train and test to draw graphs (which causes the error only when reading all the lines)
cvp=Mdl1b.Partition
The error I get
Error in ploting_ruselt (line 1)
cvp=Mdl1b.Partition
Error in ssvm (line 44)
ploting_ruselt I keep getting "Unable to resolve the name Mdl1b.Partition" everytime I read all lines of the Excel file (1000 lines) but when I limit the lines to read to 50 or so it works perfectly. I do not know why doesn’t matlab read all the lines? is there a limit to the lines matlab reads?
%reading and defining X and Y
datmi=xlsread(‘Significant desc.xlsx’);
X=datmi(2:100,4:51);
Y=datmi (2:100,2);
%deviding the result data to train and test to draw graphs (which causes the error only when reading all the lines)
cvp=Mdl1b.Partition
The error I get
Error in ploting_ruselt (line 1)
cvp=Mdl1b.Partition
Error in ssvm (line 44)
ploting_ruselt partition, excel MATLAB Answers — New Questions
Whats the reason or any logical error so i am not getting the Peak values right as i calculated mathematically
Whats the reason or any logical error so i am not getting the Peak values right as i calculated mathematically
Ist phase Rpeak = 9.1 , 2nd phase Rpeak = 33.3. 3rd Phase = 90.9, 4th Phase = 50Whats the reason or any logical error so i am not getting the Peak values right as i calculated mathematically
Ist phase Rpeak = 9.1 , 2nd phase Rpeak = 33.3. 3rd Phase = 90.9, 4th Phase = 50 Whats the reason or any logical error so i am not getting the Peak values right as i calculated mathematically
Ist phase Rpeak = 9.1 , 2nd phase Rpeak = 33.3. 3rd Phase = 90.9, 4th Phase = 50 matlab code MATLAB Answers — New Questions
Saving randomly generated sequence into a binary file
Hello.
I wrote a simple logistics function that i use for my pesudo random number generator.I want to test it’s randomness so i downloaded a custom windows version of NIST STS.
the program rqeuires you to input the location of the binary file (.bin) of your data. i tried this code to save my sequence to .bin file but the program doesn’t recognize it.
please help.
the NIST-STS site : https://randomness-tests.fi.muni.cz/
i tried the demo .bin data that came with the software and it worked. only mine is being refused.
the code :
fileID = fopen(‘Sequence.bin’,’w’);
fwrite(fileID,(PRBG));
fclose(fileID);Hello.
I wrote a simple logistics function that i use for my pesudo random number generator.I want to test it’s randomness so i downloaded a custom windows version of NIST STS.
the program rqeuires you to input the location of the binary file (.bin) of your data. i tried this code to save my sequence to .bin file but the program doesn’t recognize it.
please help.
the NIST-STS site : https://randomness-tests.fi.muni.cz/
i tried the demo .bin data that came with the software and it worked. only mine is being refused.
the code :
fileID = fopen(‘Sequence.bin’,’w’);
fwrite(fileID,(PRBG));
fclose(fileID); Hello.
I wrote a simple logistics function that i use for my pesudo random number generator.I want to test it’s randomness so i downloaded a custom windows version of NIST STS.
the program rqeuires you to input the location of the binary file (.bin) of your data. i tried this code to save my sequence to .bin file but the program doesn’t recognize it.
please help.
the NIST-STS site : https://randomness-tests.fi.muni.cz/
i tried the demo .bin data that came with the software and it worked. only mine is being refused.
the code :
fileID = fopen(‘Sequence.bin’,’w’);
fwrite(fileID,(PRBG));
fclose(fileID); encryption, image processing, binary, output MATLAB Answers — New Questions
What is the difference between oobPredict and predict with ensemble of bagged decision trees?
1- I am using both fuctions to predict a response through random forest, but the predict function gives higher percentage of explained variance compared to oobPredict. Why is it so? – I think there is some fundamental thing that I have not yet fully grasped.
2- If there is something different between these methods in the way that they weigh trees how can I make these methods homogenous?
3- Can one use oobPredict in someway to make predictions with a new set of data?1- I am using both fuctions to predict a response through random forest, but the predict function gives higher percentage of explained variance compared to oobPredict. Why is it so? – I think there is some fundamental thing that I have not yet fully grasped.
2- If there is something different between these methods in the way that they weigh trees how can I make these methods homogenous?
3- Can one use oobPredict in someway to make predictions with a new set of data? 1- I am using both fuctions to predict a response through random forest, but the predict function gives higher percentage of explained variance compared to oobPredict. Why is it so? – I think there is some fundamental thing that I have not yet fully grasped.
2- If there is something different between these methods in the way that they weigh trees how can I make these methods homogenous?
3- Can one use oobPredict in someway to make predictions with a new set of data? random forest, regression, machine learning, curve fitting, decision trees, bagging, oob MATLAB Answers — New Questions
iteration newton raphson
i am having difficulty trying to find an iteration formula using newton-raphson for solving the equation x=cos(2x) and write an m-file for finding the solution whereby x matches cos(2x) to atleast 8 decimal places using format long. can anybody help me?i am having difficulty trying to find an iteration formula using newton-raphson for solving the equation x=cos(2x) and write an m-file for finding the solution whereby x matches cos(2x) to atleast 8 decimal places using format long. can anybody help me? i am having difficulty trying to find an iteration formula using newton-raphson for solving the equation x=cos(2x) and write an m-file for finding the solution whereby x matches cos(2x) to atleast 8 decimal places using format long. can anybody help me? iteration newton-raphson MATLAB Answers — New Questions
How to communicate with TCSPC via MATLAB?
Hello
I’m a graduate student in bioimaging lab.
In our lab, we have TCSPC device from company Becker & Hickl (BH) and it is connected through PCI bus.
It’s possible to use TCSPC via software developed from BH, but I want to use several functions of TCSPC via our imaging program written by MATLAB.
I tried to use several MATLAB functions (‘visadev’,’visadevfind’,etc.) to communicate with TCSPC, but I couldn’t connect to TCSPC via MATLAB.
Here’s the quetions to ask
1) Is there any reference code written in MATLAB which is used for communication with TCSPC via MATLAB?
2) If not, could I get some guidances for that? I downloaded .dll files from BH.Hello
I’m a graduate student in bioimaging lab.
In our lab, we have TCSPC device from company Becker & Hickl (BH) and it is connected through PCI bus.
It’s possible to use TCSPC via software developed from BH, but I want to use several functions of TCSPC via our imaging program written by MATLAB.
I tried to use several MATLAB functions (‘visadev’,’visadevfind’,etc.) to communicate with TCSPC, but I couldn’t connect to TCSPC via MATLAB.
Here’s the quetions to ask
1) Is there any reference code written in MATLAB which is used for communication with TCSPC via MATLAB?
2) If not, could I get some guidances for that? I downloaded .dll files from BH. Hello
I’m a graduate student in bioimaging lab.
In our lab, we have TCSPC device from company Becker & Hickl (BH) and it is connected through PCI bus.
It’s possible to use TCSPC via software developed from BH, but I want to use several functions of TCSPC via our imaging program written by MATLAB.
I tried to use several MATLAB functions (‘visadev’,’visadevfind’,etc.) to communicate with TCSPC, but I couldn’t connect to TCSPC via MATLAB.
Here’s the quetions to ask
1) Is there any reference code written in MATLAB which is used for communication with TCSPC via MATLAB?
2) If not, could I get some guidances for that? I downloaded .dll files from BH. communication MATLAB Answers — New Questions
GPS time extraction using GPSDO module for USRP N210
Hi
I am working on TDOA geolocation setup with 5 USRP N210, and GPSDO modules, I wish to extract the GPS time vector along with captured I/Q data on 5 USRPs installed at distant locations. This GPS time vector on each USRP will give me the time-stamp information which is necessary for aligning the captured data to work out the TDOA cross-correlation.
Can anybody provide me MATLAB commands to capture the GPS time vector?
Please help.
ThanksHi
I am working on TDOA geolocation setup with 5 USRP N210, and GPSDO modules, I wish to extract the GPS time vector along with captured I/Q data on 5 USRPs installed at distant locations. This GPS time vector on each USRP will give me the time-stamp information which is necessary for aligning the captured data to work out the TDOA cross-correlation.
Can anybody provide me MATLAB commands to capture the GPS time vector?
Please help.
Thanks Hi
I am working on TDOA geolocation setup with 5 USRP N210, and GPSDO modules, I wish to extract the GPS time vector along with captured I/Q data on 5 USRPs installed at distant locations. This GPS time vector on each USRP will give me the time-stamp information which is necessary for aligning the captured data to work out the TDOA cross-correlation.
Can anybody provide me MATLAB commands to capture the GPS time vector?
Please help.
Thanks gps synchronization, gpsdo, usrp n210, tdoa geolocation MATLAB Answers — New Questions
Issue in Reading serial data from the Arduino Uno in Simulink using Serial receive block
I’m using an Arduino Uno with Simulink and trying to read serial data using the Serial Receive block. The Arduino is printing voltage values from an analog sensor as follows:
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
However, I’m facing a conflict because the Serial Receive block and External Mode are trying to use Serial Port 0, which is the only hardware serial port available on the Arduino Uno.
My Setup:
Hardware: Arduino Uno
Simulink Blocks:
Serial Receive block to capture the data sent from Arduino
Mode: I attempted to use both Connected I/O and External mode (Run on board), but as the simulation doesn’t allow to change the the serial port from 0 in either mode, nor can I change the pin number in the Serial Receive block.
Problem:
When I run the model, I receive the following errors:
Run with I/O
Caused by: Serial Port 0 used by the Serial Receive block, is also used for Connected I/O. Change the port number used by the block in your model.
Run on baord
Serial Port 0 used by the Serial Receive block is also used for External mode. Change the port number used by the block.
However, the Arduino Uno only has one hardware serial port, and there’s no option to change the serial port in the Serial Receive block or in the hardware setting in the Simulink.
How can I resolve this conflict and successfully read serial data from the Arduino Uno in Simulink?I’m using an Arduino Uno with Simulink and trying to read serial data using the Serial Receive block. The Arduino is printing voltage values from an analog sensor as follows:
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
However, I’m facing a conflict because the Serial Receive block and External Mode are trying to use Serial Port 0, which is the only hardware serial port available on the Arduino Uno.
My Setup:
Hardware: Arduino Uno
Simulink Blocks:
Serial Receive block to capture the data sent from Arduino
Mode: I attempted to use both Connected I/O and External mode (Run on board), but as the simulation doesn’t allow to change the the serial port from 0 in either mode, nor can I change the pin number in the Serial Receive block.
Problem:
When I run the model, I receive the following errors:
Run with I/O
Caused by: Serial Port 0 used by the Serial Receive block, is also used for Connected I/O. Change the port number used by the block in your model.
Run on baord
Serial Port 0 used by the Serial Receive block is also used for External mode. Change the port number used by the block.
However, the Arduino Uno only has one hardware serial port, and there’s no option to change the serial port in the Serial Receive block or in the hardware setting in the Simulink.
How can I resolve this conflict and successfully read serial data from the Arduino Uno in Simulink? I’m using an Arduino Uno with Simulink and trying to read serial data using the Serial Receive block. The Arduino is printing voltage values from an analog sensor as follows:
int sensorValue = analogRead(A0);
float voltage = sensorValue * (5.0 / 1023.0);
Serial.println(voltage);
However, I’m facing a conflict because the Serial Receive block and External Mode are trying to use Serial Port 0, which is the only hardware serial port available on the Arduino Uno.
My Setup:
Hardware: Arduino Uno
Simulink Blocks:
Serial Receive block to capture the data sent from Arduino
Mode: I attempted to use both Connected I/O and External mode (Run on board), but as the simulation doesn’t allow to change the the serial port from 0 in either mode, nor can I change the pin number in the Serial Receive block.
Problem:
When I run the model, I receive the following errors:
Run with I/O
Caused by: Serial Port 0 used by the Serial Receive block, is also used for Connected I/O. Change the port number used by the block in your model.
Run on baord
Serial Port 0 used by the Serial Receive block is also used for External mode. Change the port number used by the block.
However, the Arduino Uno only has one hardware serial port, and there’s no option to change the serial port in the Serial Receive block or in the hardware setting in the Simulink.
How can I resolve this conflict and successfully read serial data from the Arduino Uno in Simulink? simulink, serial receiver, arduino MATLAB Answers — New Questions
Human Detection using YOLOV3 with own Weights
Hi everyone! I am trying to detect humans using yolov3 weights. Right now, I am trying to detect using an image but later I am going to use a camera to detect humans. I don’t know if this is possible using my own weights with my config file.Hi everyone! I am trying to detect humans using yolov3 weights. Right now, I am trying to detect using an image but later I am going to use a camera to detect humans. I don’t know if this is possible using my own weights with my config file. Hi everyone! I am trying to detect humans using yolov3 weights. Right now, I am trying to detect using an image but later I am going to use a camera to detect humans. I don’t know if this is possible using my own weights with my config file. human detection, yolov3, object detection MATLAB Answers — New Questions
Warning: Block diagram ‘XYZ’ contains disabled library links.
After deleting a model from library, I am trying to save that library, but I am coming accross a warning message as follows:
Warning: Block diagram ‘XYZ’ contains disabled library links. Use Model Advisor to find the disabled links in non-library models. The diagram has been saved but may not contain what you intended.
I can see that model advisor is able to help to resolve the Disabled library links but how can it be used to identify disabled links in non-library models.
Please suggest on this.
Regards,
Bhavnish.After deleting a model from library, I am trying to save that library, but I am coming accross a warning message as follows:
Warning: Block diagram ‘XYZ’ contains disabled library links. Use Model Advisor to find the disabled links in non-library models. The diagram has been saved but may not contain what you intended.
I can see that model advisor is able to help to resolve the Disabled library links but how can it be used to identify disabled links in non-library models.
Please suggest on this.
Regards,
Bhavnish. After deleting a model from library, I am trying to save that library, but I am coming accross a warning message as follows:
Warning: Block diagram ‘XYZ’ contains disabled library links. Use Model Advisor to find the disabled links in non-library models. The diagram has been saved but may not contain what you intended.
I can see that model advisor is able to help to resolve the Disabled library links but how can it be used to identify disabled links in non-library models.
Please suggest on this.
Regards,
Bhavnish. disabled library links MATLAB Answers — New Questions