Anonymous
Anonymous asked in Education & ReferenceHomework Help · 2 weeks ago

Can anyone solve this using the trapezoid method and no built in functions on Matlab?

Attachment image

1 Answer

Relevance
  • 2 weeks ago

    nLoop = length(x) - 1; %Because we are dealing with sequence we subtract 1 from the total length

    work = 0; % for summation purpose

    for ii = 1:nLoop

        jj = ii + 1;

        work = work + (Force(ii)*x(ii)+Force(jj)*x(jj))/2*(x(jj)-x(ii)); %See Non-uniform grid in wiki

    end

    work %Shows answer

Still have questions? Get your answers by asking now.