How to write this formula in Matlab

1 view (last 30 days)
Nicolas Ostinelli
Nicolas Ostinelli on 20 Apr 2022
Answered: Jan on 19 Jun 2022
Hello to everyone,
how can I traduce this formula in Matlab:
Ustat and Ucalib value are float number.
Thank you for your help.

Answers (2)

Abhijeet
Abhijeet on 19 Jun 2022
Hi Nicolas Ostinelli,
You can refer to the code below.Let me know if there is any error.
%constant values
U_stat=0.12;
U_calib=0.3;
U_stat_sq=U_stat*U_stat;
U_calib_sq=U_calib*U_calib;
% calculating the summation part
sum=0;
n=10;
for i=1:n
sum=sum+U_stat_sq*i;
end
sum_sqrt=sqrt(sum);
first=(1/n)*sum_sqrt;
first=first*first;
U_fin=sqrt(first+U_calib_sq);

Jan
Jan on 19 Jun 2022
Ufin = sqrt((1 / n * sum(Ustat .^ 2))^2 + Ucalib .^ 2)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!