blob: 84612186190e7d684c0f8267ddcf1d88acda697c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//chapter 8 Ex 1
clc;
clear;
close;
//let age of younger person be x
//by the given condition: equation is 3(x-6)=x+16-6;
mycoeff=[-28 2];
p=poly(mycoeff,"x","coeff");
x=roots(p);
mprintf("Their present ages are %d years and %d years",x,x+16);
|