Tag Archives: matlab
Problem with value property of uidropdown
Hi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
MichaelHi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
Michael Hi,
I’m using a uidropdown control with the Items and ItemsData properties set within the method startupFcn of my app. I’m using the following simple code to specify the items of the dropdown control along with numeric IDs:
app.MethodDropDown.Items = Methods.TYPES(:, 1);
app.MethodDropDown.ItemsData = [Methods.TYPES{:, 2}];
Methods.Types is a cell-array in class Methods with the first column containing character arrays (i.e. the names for the method types) and the second column contains numeric ID values for the method types.
When retrieving the value of the selected item I observe a different behavior between different MATLAB versions. Up to 2022b the Value property returns the numeric value of the selected item as specified in ItemsData. However, starting with 2023a, a string (i.e. in my case a character array) is returned.
Am I doing something wrong? I suspect that something changed between 2022b and 2023a but I can’t find anything about such a change in the changelog of MATLAB. Moreover, the documentation of 2023a still states that my code seems to be correct.
Best,
Michael uidropdown, value, items, itemsdata MATLAB Answers — New Questions
slhostlibcantransmit.dll INITIALIZE Error when I try to connect to my ECU through XCP on CAN (using Vehicle Network Toolbox blocks)
I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out?I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out? I am trying to read an ECU variable using Vehicle Network Toolbox blocks on my simulink model. The a2l file is added in the XCP CAN Configuration block. The XCP CAN Data Acquisiton block is used for getting the measurement I want to read and the XCP CAN Transport Layer block is used for connecting to the XCP channel which is through a Kvaser device.
On running the model, I get the following error:
=== Diagnostics ===
Error:Error running ‘HVS_Model_V01_CD6_TestPC’ on target computer: Unable to load ‘HVS_Model_V01_CD6_TestPC’ on target computer ‘TargetPC1’: HVS_Model_V01_CD6_TestPC:INITIALIZE ERROR:Could not open library: slhostlibcantransmit.dll
Can anyone help me out? xcponcan, vehiclenetworktoolbox, vnt, slhostlibcantransmit.dll MATLAB Answers — New Questions
Index exceeds the number of array elements
Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me?Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me? Hi,
I got the error written below.
Index exceeds the number of array elements. Index must not exceed 2.
Error in MasterPlan_RCC_V2_2(line 73)
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
Line 73 is written in bold black.
Tolerance_D = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*Inputs_RCC.cRate_DCH) < AcceptedErrorCurrent;
RCC_Step_CHG = {}; % Find the unique steps for the Discharge rates
for i = 1:size(Inputs_RCC.cRates_CHG,1)
Tolerance_C = abs(Files.PreProcessedData{idx}.Current_A – Rated_Cap*cell2mat(Inputs_RCC.cRates_CHG(i))) < AcceptedErrorCurrent;
% Record the unique step if it’s CC step, charge and the C-Rate is the one from the pulses
if i == 1
CHG_step = Files.PreProcessedData{idx}.FlagUniqueStep(Tolerance_C & contains(Files.PreProcessedData{idx}.Mode, "C_CC"));
CHG_step = unique(CHG_step);
CHG_step = CHG_step(CHG_step > Cap_Check_Steps(end)); % Take the steps after the cap check not to repeat them
CHG_step = CHG_step(1:Inputs_RCC.CyclesxcRate); % Based on how many cycles x C-rate
RCC_Step_CHG = [RCC_Step_CHG; num2cell(CHG_step)];
This is for test protocol of battery. So, the protocol is shown below:
"CHG step (Charge step), C-rates are C/, C/3, C/2, 1C and 2C."
Charge Steps 3 cycles at each C-rate
C/5 with C/20 cut-off
C/3 with C/20 cut-off
C/2 with C/20 cut-off
1C with C/20 cut-off
"2C
with C/20 cut-off"
Can someone please help me? index exceeds, number of array MATLAB Answers — New Questions
draw polygon continuously with mouse
לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit.לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit. לק"י
Hi guys,
I need to contour some cells. I want to use the drawpolygon command, or an equivalent of it, that will record mouse position continuously while mouse left click button is held. No such option seems to be in the drawpolygon documentation.
There are some old answers about how to do it, the problem is that most of the codes there somewhy don’t work when I try to use them. Is there any other easy/quick way to obtain mouse position only when left mouse button is held?
Thanks,
Amit. drawpolygon, mouse position, cell contour, contour MATLAB Answers — New Questions
Store a script as a function
I made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? ThanksI made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? Thanks I made some changes in an already existing function file "randomstart" downloaded from Mathworks reinforcement learning on ramp course. When I made few changes in that file and tried to save it, I got the message as shown in the pic attached
when I clicked on the overwrite button, the script file no longer remains a function file. It simply changes to an ordinary .mlx file which cannot be called from the main function of trainDDPG.mlx. Similar is the case with ‘Select Another File…" option. Can anyone help me what to do? Thanks save, function MATLAB Answers — New Questions
How to remove the error “Can not resolve Simulink signal object for output port” in matlab 2009b
Hello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank youHello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank you Hello
Im experiencing an error in simulink "Can not resolve Simulink signal object for output port" in Matlab 2009b
Can someone suggest the any ideas on how to resolve this?
Thank you matlab, simulink, signal MATLAB Answers — New Questions
Why i am getting this kind of warning in my code outer loop index i is inside the nested function
Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next.Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next. Why i am getting this kind of warning in my code outer loop index i is inside the nested function. i shared the code file. kindly guide me what to do next. matlab code MATLAB Answers — New Questions
Unable to delete derived entry in sldd
When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error.When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error. When I try to delete data dictionary (*.sldd) entries, I get the error "Unable to delete derived entry".
I searched for this error in the documentation and online but could not find what is the cause of this error. data dictionary, matlab, simulink MATLAB Answers — New Questions
License manager error -8. I want to change my license from old to new computer.
The licence has been transferred from old laptop to new. But I get this error.The licence has been transferred from old laptop to new. But I get this error. The licence has been transferred from old laptop to new. But I get this error. licence error, when trying to change computer MATLAB Answers — New Questions
Collect information of a file with the same kind of text pattern
Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently?Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently? Dear all
I have the same kind of text file that I am attaching to this question in different folders in my MatLab path. As you can see, from line 42 to the end of the file, there are text blocks like:
Cr1 Cr2 ( 0, 0, 0) 2.6832 ( 0.000, -4.001, 0.000) 4.001
J_iso: 2.6832
[Testing!] Jprime: 10.082, B: -4.132
[Testing!] DMI: ( 0.0635 0.0000 -0.0306)
[Testing!]J_ani:
[[-1.401 0. 0.396]
[ 0. -0.327 0. ]
[ 0.396 0. -8.263]]
I would be interested in MatLab collecting information from this kind of patterns as follows:
As you can see, at the end of the first line of the text block that I put before as an example, the number 4.001 can be found. There are other text blocks with the last element of the first line ending in that specific number, but also on other values, like 6.930. It would be great if for each occurrence of the element 4.001 (and also for 6.930) as the last element of the first line of a text block MatLab creates a line with the following information in a line:
(i) First column: number index of the first Crx appearance (in the example above, 1)
(ii) Second column: number index of the second Crx appearance (in the example above, 2)
(iii) Third to fifth columns: the three elements in the first parenthesis of the first line (in the example above, 0 0 0)
(iv) Sixth to eighth columns: the three elements inside the parenthesis of the fourth line of the text block (that it is, what it is after the text "[Testing!] DMI:". In this case, 0.0635 0.0000 -0.0306).
So first line would be 1 2 0 0 0 0.0635 0.0000 -0.0306. Same for all the occurrences of 6.930 as the last element of the first line of the text blocks.
Any idea on how to do this efficiently? text patterns MATLAB Answers — New Questions
How to determine the minimum point of a plot?
Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please.Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please. Hi,
I have a plot as attached herewith in which the value of the point as shown by arrow mark is to be determined and compared to a reference value. It is plotted at a time step of 999 (t ranges from 1 to 1000).
global data;
cp=0;
for i=999:max(length(data.variable.t))
for j=60:max(length(data.variable.x))-1
if data.variable.curvepressure(i,j) <= -10.2661
disp(data.variable.curvepressure(i,j))
cp=1;
break
end
end
end
The above code is not working and need your advice please. transferred MATLAB Answers — New Questions
Plotting deflection of beam using macaulay functions
I am trying to plot the deflection of a beam under bending forces. My understanding is to use the heaviside function but i am having trouble plotting these points. An example of this function would be: slope=(1/(E*I))*(146.5*<x>^2+315<x-0.12>^2-70.24*,x.^3)I am trying to plot the deflection of a beam under bending forces. My understanding is to use the heaviside function but i am having trouble plotting these points. An example of this function would be: slope=(1/(E*I))*(146.5*<x>^2+315<x-0.12>^2-70.24*,x.^3) I am trying to plot the deflection of a beam under bending forces. My understanding is to use the heaviside function but i am having trouble plotting these points. An example of this function would be: slope=(1/(E*I))*(146.5*<x>^2+315<x-0.12>^2-70.24*,x.^3) macaulay, deflection of beam MATLAB Answers — New Questions
how to convert or generate prn files to xlsx files
i have .prn files i want to covert those files to xlsx filesi have .prn files i want to covert those files to xlsx files i have .prn files i want to covert those files to xlsx files multiple prn files to xlsx files MATLAB Answers — New Questions
I face a problem with the dimensions of Z as it should be a 2×2 matrix.
%——Creating a strain matrix———–%
E = zeros(2*(size(K1,1)-1),2*(size(K1,1)-1));
for j = 1: (size(K1,1)-1)
for i = 1: (size(K1,1)-1)
v = [zpk1(j,i);zpk2(j,i);zpk1(j,i+1);zpk2(j,i+1);zpk1(j+1,i+1);zpk2(j+1,i+1);zpk1(j+1,i);zpk2(j+1,i)];
e1= strain1(v);
e2= strain2(v);
e3= strain3(v);
e4= strain4(v);
E((2*j-1),(2*i-1)) = e1(1);
E((2*j-1),2*i) = e2(1);
E(2*j,(2*i-1)) = e4(1);
E(2*j,2*i) = e3(1);
end
end
su = round(4*d/g)+1;
r = E((((su-1)- round(d/g)):-1:1),(su-1));
p = E((((su-1)- round(d/g)):-1:1),(su));
st = (p+r)./(1.5*(10)^(-4));
m = g*(size(r)-1);
H = 0:g:(m);
h = H./10;
writematrix(st)
type ‘st.txt’
writematrix(h)
type ‘h.txt’
plot(h,st)
xlim([0 1.5])
xlabel("X2/d",’fontsize’,14)
ylabel("Normalised Strain along vertical path", ‘fontsize’,13)
legend("d/w = 0.5")
saveas(gcf,’plot.png’)
contourf(st)
colorbar
saveas(gcf,’contour.png’)
The final plot of the above code should resemble something like this:
I have double chekced, the formula is correct and the value of st at a given r and p match with the experimental results. However, I face a problem with the dimensions of Z as it should be a 2×2 matrix.
Thank you in advance.%——Creating a strain matrix———–%
E = zeros(2*(size(K1,1)-1),2*(size(K1,1)-1));
for j = 1: (size(K1,1)-1)
for i = 1: (size(K1,1)-1)
v = [zpk1(j,i);zpk2(j,i);zpk1(j,i+1);zpk2(j,i+1);zpk1(j+1,i+1);zpk2(j+1,i+1);zpk1(j+1,i);zpk2(j+1,i)];
e1= strain1(v);
e2= strain2(v);
e3= strain3(v);
e4= strain4(v);
E((2*j-1),(2*i-1)) = e1(1);
E((2*j-1),2*i) = e2(1);
E(2*j,(2*i-1)) = e4(1);
E(2*j,2*i) = e3(1);
end
end
su = round(4*d/g)+1;
r = E((((su-1)- round(d/g)):-1:1),(su-1));
p = E((((su-1)- round(d/g)):-1:1),(su));
st = (p+r)./(1.5*(10)^(-4));
m = g*(size(r)-1);
H = 0:g:(m);
h = H./10;
writematrix(st)
type ‘st.txt’
writematrix(h)
type ‘h.txt’
plot(h,st)
xlim([0 1.5])
xlabel("X2/d",’fontsize’,14)
ylabel("Normalised Strain along vertical path", ‘fontsize’,13)
legend("d/w = 0.5")
saveas(gcf,’plot.png’)
contourf(st)
colorbar
saveas(gcf,’contour.png’)
The final plot of the above code should resemble something like this:
I have double chekced, the formula is correct and the value of st at a given r and p match with the experimental results. However, I face a problem with the dimensions of Z as it should be a 2×2 matrix.
Thank you in advance. %——Creating a strain matrix———–%
E = zeros(2*(size(K1,1)-1),2*(size(K1,1)-1));
for j = 1: (size(K1,1)-1)
for i = 1: (size(K1,1)-1)
v = [zpk1(j,i);zpk2(j,i);zpk1(j,i+1);zpk2(j,i+1);zpk1(j+1,i+1);zpk2(j+1,i+1);zpk1(j+1,i);zpk2(j+1,i)];
e1= strain1(v);
e2= strain2(v);
e3= strain3(v);
e4= strain4(v);
E((2*j-1),(2*i-1)) = e1(1);
E((2*j-1),2*i) = e2(1);
E(2*j,(2*i-1)) = e4(1);
E(2*j,2*i) = e3(1);
end
end
su = round(4*d/g)+1;
r = E((((su-1)- round(d/g)):-1:1),(su-1));
p = E((((su-1)- round(d/g)):-1:1),(su));
st = (p+r)./(1.5*(10)^(-4));
m = g*(size(r)-1);
H = 0:g:(m);
h = H./10;
writematrix(st)
type ‘st.txt’
writematrix(h)
type ‘h.txt’
plot(h,st)
xlim([0 1.5])
xlabel("X2/d",’fontsize’,14)
ylabel("Normalised Strain along vertical path", ‘fontsize’,13)
legend("d/w = 0.5")
saveas(gcf,’plot.png’)
contourf(st)
colorbar
saveas(gcf,’contour.png’)
The final plot of the above code should resemble something like this:
I have double chekced, the formula is correct and the value of st at a given r and p match with the experimental results. However, I face a problem with the dimensions of Z as it should be a 2×2 matrix.
Thank you in advance. simulation, abaqus MATLAB Answers — New Questions
I am getting a ‘You do not have a valid license file’ whenever I launch MATLAB after installing even though I have a valid student license.
I get a ‘ you do not have a valid license file’ whenever I try to launch MATLAB. I tried to delete and reinstall it but that did not help. Please note that I have a valid student license and I’m able to use MATLAB online with that license.I get a ‘ you do not have a valid license file’ whenever I try to launch MATLAB. I tried to delete and reinstall it but that did not help. Please note that I have a valid student license and I’m able to use MATLAB online with that license. I get a ‘ you do not have a valid license file’ whenever I try to launch MATLAB. I tried to delete and reinstall it but that did not help. Please note that I have a valid student license and I’m able to use MATLAB online with that license. you do not have a valid license file, license MATLAB Answers — New Questions
Error while creating s-function build related to real_T and time_T
I have C project and I’m trying to build a s-function for the C-project so that I can use the s-function for simulations in loop with some plant models. However I’m getting the following error
simstruc_types.h:134:5: error: unknown type name ‘real_T’ real_T** taskTime
rtw_solver.h:55:5: error: unknown type name ‘time_T’ time_T* stepSizePtr;
The same errors reflected in many other files. I just gave two examples just to explain the scenario. What should I do to get rid of the error?I have C project and I’m trying to build a s-function for the C-project so that I can use the s-function for simulations in loop with some plant models. However I’m getting the following error
simstruc_types.h:134:5: error: unknown type name ‘real_T’ real_T** taskTime
rtw_solver.h:55:5: error: unknown type name ‘time_T’ time_T* stepSizePtr;
The same errors reflected in many other files. I just gave two examples just to explain the scenario. What should I do to get rid of the error? I have C project and I’m trying to build a s-function for the C-project so that I can use the s-function for simulations in loop with some plant models. However I’m getting the following error
simstruc_types.h:134:5: error: unknown type name ‘real_T’ real_T** taskTime
rtw_solver.h:55:5: error: unknown type name ‘time_T’ time_T* stepSizePtr;
The same errors reflected in many other files. I just gave two examples just to explain the scenario. What should I do to get rid of the error? simulink, s-function, build MATLAB Answers — New Questions
hdlset_param question
As part of an automated HDL coder script, I need to check for all Reference Models used within the design that the ‘ReferenceModelPrefix’ which is accessed as ‘HDL Block Properties’ is clear. The script sets ‘ReferenceModelPrefix’ using the following:-
hdlset_param(refModelsFullPath{i}, ‘ReferenceModelPrefix’, ”)
refModelsFullPath{i} is an array that I use to generate the absolute hierarchy path for each Reference Model in my design.
This works perfectly for a hierarchical path such as the following:-
SubSystem_Top/SubSystel_level1/RefModel_a
If I have a Reference model embedded inside RefModel_a giving me the following hierarchy:-
SubSystem_Top/SubSystel_level1/RefModel_a/RefModel_b
Then the hdlset_param command fails with an error:-
In this case ‘ mss_rx_ss’ is equivalent to my ‘RefModel_a’
I’m assuming that I can’t use an absolute path that contains multiple hierarchical levels of Model Reference, is there an equvalent command or alternative that I could use to set the ‘ReferenceModelPrefix’ parameter this way?
Many thanks in advance.As part of an automated HDL coder script, I need to check for all Reference Models used within the design that the ‘ReferenceModelPrefix’ which is accessed as ‘HDL Block Properties’ is clear. The script sets ‘ReferenceModelPrefix’ using the following:-
hdlset_param(refModelsFullPath{i}, ‘ReferenceModelPrefix’, ”)
refModelsFullPath{i} is an array that I use to generate the absolute hierarchy path for each Reference Model in my design.
This works perfectly for a hierarchical path such as the following:-
SubSystem_Top/SubSystel_level1/RefModel_a
If I have a Reference model embedded inside RefModel_a giving me the following hierarchy:-
SubSystem_Top/SubSystel_level1/RefModel_a/RefModel_b
Then the hdlset_param command fails with an error:-
In this case ‘ mss_rx_ss’ is equivalent to my ‘RefModel_a’
I’m assuming that I can’t use an absolute path that contains multiple hierarchical levels of Model Reference, is there an equvalent command or alternative that I could use to set the ‘ReferenceModelPrefix’ parameter this way?
Many thanks in advance. As part of an automated HDL coder script, I need to check for all Reference Models used within the design that the ‘ReferenceModelPrefix’ which is accessed as ‘HDL Block Properties’ is clear. The script sets ‘ReferenceModelPrefix’ using the following:-
hdlset_param(refModelsFullPath{i}, ‘ReferenceModelPrefix’, ”)
refModelsFullPath{i} is an array that I use to generate the absolute hierarchy path for each Reference Model in my design.
This works perfectly for a hierarchical path such as the following:-
SubSystem_Top/SubSystel_level1/RefModel_a
If I have a Reference model embedded inside RefModel_a giving me the following hierarchy:-
SubSystem_Top/SubSystel_level1/RefModel_a/RefModel_b
Then the hdlset_param command fails with an error:-
In this case ‘ mss_rx_ss’ is equivalent to my ‘RefModel_a’
I’m assuming that I can’t use an absolute path that contains multiple hierarchical levels of Model Reference, is there an equvalent command or alternative that I could use to set the ‘ReferenceModelPrefix’ parameter this way?
Many thanks in advance. matlab, simulink, hdl coder MATLAB Answers — New Questions
data stops after 6-7 transmissions
data stops after 6-7 transmissionsdata stops after 6-7 transmissions data stops after 6-7 transmissions thingspeak, arduinouno MATLAB Answers — New Questions
Why can’t I discard a single trial in experiment manager?
I am doing a basiyan method to optimize the hyperparameters used in training an RL agent. However, I can’t discard a single trial in experiment manager. when I right click on any of the trials, the discard button is gray.I am doing a basiyan method to optimize the hyperparameters used in training an RL agent. However, I can’t discard a single trial in experiment manager. when I right click on any of the trials, the discard button is gray. I am doing a basiyan method to optimize the hyperparameters used in training an RL agent. However, I can’t discard a single trial in experiment manager. when I right click on any of the trials, the discard button is gray. experiment manager, hyperparameter optimization MATLAB Answers — New Questions
couldn’t open twain device. check cables.
hay guys i use matlab to acces my scanner using CMD TWAIN. for a while i use it properly but now i can’t use my cmd twain and got notif like that. how to solved it?? i have check the cbale and it’s normal but still got that warnning. please help me to solve it.
http://www.gssezisoft.com/main/cmdtwain-download/hay guys i use matlab to acces my scanner using CMD TWAIN. for a while i use it properly but now i can’t use my cmd twain and got notif like that. how to solved it?? i have check the cbale and it’s normal but still got that warnning. please help me to solve it.
http://www.gssezisoft.com/main/cmdtwain-download/ hay guys i use matlab to acces my scanner using CMD TWAIN. for a while i use it properly but now i can’t use my cmd twain and got notif like that. how to solved it?? i have check the cbale and it’s normal but still got that warnning. please help me to solve it.
http://www.gssezisoft.com/main/cmdtwain-download/ image acquisition, cmdtwain, gui, guide MATLAB Answers — New Questions