Question

n2 if n 10 2. Let f(n)3n2 2 if 10 n < 30 4n if n 2 30 Create an m-fhle with a program to find the sum 50 Σ f(n). n=1 Hint: YoMake this program using MATLAB AND SHOW THE DETAIL WORKING

0 0
Add a comment Improve this question Transcribed image text
Answer #1


8Matlab code for finding sum of n terms clear al1 close all %initialize the sum s-0: Finding sum of 50 terms for n-1:50 if n<

%%Matlab code for finding sum of n terms
clear all
close all
%initialize the sum
s=0;
%Finding sum of 50 terms
for n=1:50
  
    if n<10
        s=s+(n^2+1);
      
    elseif n>=10 && n<30
        s=s+(3*n^2+2);
      
    elseif n>=30
        s=s+(4*n+1);
      
    end
  
end

fprintf('\n\tSum of first 50 terms = %f.\n',s)

%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%
       

Add a comment
Know the answer?
Add Answer to:
Make this program using MATLAB AND SHOW THE DETAIL WORKING n2 if n 10 2. Let f(n)3n2 2 if 10 n < 30 4n if n 2 30 Crea...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT