Question: matlab function: function [centroid] = find_Centroid(subAreas, y_hat) A=0; AreaMoment =0; for i=1 : length(subAreas) AreaMoment = AreaMoment+subAreas(i) * y_hat(i); A = A + subAreas (i);

matlab function:
function [centroid] = find_Centroid(subAreas, y_hat)
A=0;
AreaMoment =0;
for i=1 : length(subAreas)
AreaMoment = AreaMoment+subAreas(i) * y_hat(i);
A = A + subAreas (i);
end
centroid = AreaMoment / A;
end
what will be the output of the followint script?
%List of sub areas
AA=[10, 5, 5];
%List of centroid sub areas
y= [5, 3, -2];
%Find the centroid
cntrd= find_Centroid(AA, y);
disp(cntrd)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!