Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

modify the Matlab script to provide two new versions. % Ask for the start and end values start = input('Please enter the start value'); finish

modify the Matlab script to provide two new versions.

% Ask for the start and end values start = input('Please enter the start value'); finish = input('Please enter the finish value'); No_intervals = input('How many intervals?'); % Note: There is additional checking to do here - what is it? % Calculate the interval size interval_size = (finish-start) / No_intervals; % Intergral value will be stored in result; result = 0; % Loop over the range - the function we summing is x^2 for x = start:interval_size:(finish-interval_size) result = result + 0.5 * ( Function_to_Integrate(x) + Function_to_Integrate(x+interval_size) ) * interval_size; end % Display the answer fprintf("The integral of x^2 between x=%d and x=%d is %f ",start,finish,result); % ---------------------------------------- % This is the funtion you will be integrating (y=x^2) function y = Function_to_Integrate(x) y = x*x; end

1) A version that uses parfor

2) convert this code into a version that uses four parallel workers (spmd)

Help!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

=+Explain the skills needed to create a sustainable personal bran

Answered: 1 week ago