Question

Ni = 6, N2 = 36. Write a Matlab program calculating; N2 A= (1/11)N1eN Hi=N1 1b- f(x) = ln (12) L3 N1 [x3*N1 N2/(cos(N1)]

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

1.)

  • The Expression A is a summation expression.
  • We can calculate this by with and without for loop, we will do both.

using for loop:

  • Set A = 0
  • loop for i = N1 to N2
  • add  (1/factorial(N1))^N1*exp(N1) to A

program:

N1 = 6;

N2 = 36;

A = 0;

for i = N1:N2

A = A+ (1/factorial(N1))^N1*exp(N1);

end

disp(A)

output:
N1 = 6; N2 = 36; A = 0; for i = N1: N2 A = A+ (1/factorial (N1)) ^Nl*exp(N1); end disp(A) 8.9770e-14

without for loop:

  • A can be given as A =(N2-N1+1)*(1/factorial(N1))^N1*exp(N1), That is , the summation expression multiplied by N2-N1+1

program:

N1 = 6;

N2 = 36;

A =(N2-N1+1)*(1/factorial(N1))^N1*exp(N1);

disp(A)

output:
Ni 6; 36; N2 = (N2-N1+1)* (1/factorial (N1)) ^Nl *exp(N1); disp (A) 8.9770e-14

1b)

  • Define a function handle f to calculate f(x)
  • Then substituate any value for x to obtain a result.

program:

N1 = 6;

N2 = 36;

f = @(x)log(N1/12)*(x.^(3*N1)*exp(N2/cos(N1)));

x = -10:0.01:10;

plot(x,f(x));

xlabel("x");

ylabel("y");

title("x vs. f(x)")

grid on;

outputs

0 x vs. f(x) x1043 -2 -4 у 09 -10 -12 -14 -10 -5 5 10 0 х

Add a comment
Know the answer?
Add Answer to:
Ni = 6, N2 = 36. Write a Matlab program calculating; N2 A= (1/11)N1eN Hi=N1 1b-...
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