Why is it when I am adding a number to array, the single number overrides array
Currently trying to add a single number to an array, but despite the array initially outputting well, the moment I try to add to it, the entire array is replaced by the number I am adding. This can be best seen by running "lownutant" which outputs a 1×50 array, but adding 1 changes all values to 1.
% Modified Ramberg-Osgood Tension
E=10.3*10^6; %psi
Fty=68000; %psi
Ftu=76000; %psi
fnl=linspace(0,Ftu,250);
e0=0.09;
epu=e0-(Ftu/E);
nt=log(epu/.002)/log(Ftu/Fty);
enl=(fnl./E)+(0.002.*((fnl./Fty).^nt));
% Tangent Modulus
dEtan=linspace(.025,.03,50) %Domain for plotting Etan
lownutant=((.002.*E.*nt./Fty)).*((dEtan./Fty).^(nt-1))
a=1
b= a+lownutantCurrently trying to add a single number to an array, but despite the array initially outputting well, the moment I try to add to it, the entire array is replaced by the number I am adding. This can be best seen by running "lownutant" which outputs a 1×50 array, but adding 1 changes all values to 1.
% Modified Ramberg-Osgood Tension
E=10.3*10^6; %psi
Fty=68000; %psi
Ftu=76000; %psi
fnl=linspace(0,Ftu,250);
e0=0.09;
epu=e0-(Ftu/E);
nt=log(epu/.002)/log(Ftu/Fty);
enl=(fnl./E)+(0.002.*((fnl./Fty).^nt));
% Tangent Modulus
dEtan=linspace(.025,.03,50) %Domain for plotting Etan
lownutant=((.002.*E.*nt./Fty)).*((dEtan./Fty).^(nt-1))
a=1
b= a+lownutant Currently trying to add a single number to an array, but despite the array initially outputting well, the moment I try to add to it, the entire array is replaced by the number I am adding. This can be best seen by running "lownutant" which outputs a 1×50 array, but adding 1 changes all values to 1.
% Modified Ramberg-Osgood Tension
E=10.3*10^6; %psi
Fty=68000; %psi
Ftu=76000; %psi
fnl=linspace(0,Ftu,250);
e0=0.09;
epu=e0-(Ftu/E);
nt=log(epu/.002)/log(Ftu/Fty);
enl=(fnl./E)+(0.002.*((fnl./Fty).^nt));
% Tangent Modulus
dEtan=linspace(.025,.03,50) %Domain for plotting Etan
lownutant=((.002.*E.*nt./Fty)).*((dEtan./Fty).^(nt-1))
a=1
b= a+lownutant limited precision, add big number to extremely small number MATLAB Answers — New Questions