Can someone help me create a script to solve the following?

12 views (last 30 days)
I tried creating scripts to solve each question but I honestly have no idea what I'm doing, any help will be appreciated!

Answers (1)

Kevin Chng
Kevin Chng on 9 Oct 2018
Edited: Kevin Chng on 9 Oct 2018
Question 1 Answer
a= 1;
r= 1/7;
n= 6;
s = a*r.^(0:n-1);
later, you put format long to calculate the exact value.
Question 2 Answer
syms x;
eqn = (4*x^2 -32*x+64) == 0;
solx = solve(eqn,x)
or
a= 4;
b = -32;
c=64;
x(1) = (-b + sqrt(b^2 - 4*a*c))/(2*a);
x(2) = (-b - sqrt(b^2 - 4*a*c))/(2*a);
okay, i guess my hint is good enough for you to solve question 3.
  6 Comments
Kevin Chng
Kevin Chng on 9 Oct 2018
Agree with what you say. I did't think that much before. "hard work pays off"., they should put some efforts on it if they are willing to learn.
Kevin Seetaram
Kevin Seetaram on 9 Oct 2018
So should I post what I did beforehand because I already had number 1 just didn’t know how to solve it simultaneously. Don’t like what was previously said about me not doing the script because if you look at my history I already got help with it and could fully explain how to do it.

Sign in to comment.

Products


Release

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!