Professional Documents
Culture Documents
You Can Download Suggested Book From: Long G
You Can Download Suggested Book From: Long G
x=1/3
x =
0.3333
format long g
x=1/3
x =
0.333333333333333
format short
x=1/3
x =
0.3333
c=200.56
c =
200.5600
d=6
d =
e=d^c
e =
1.1642e+156
Scietific Calculator
sqrt(2)
ans =
1.4142
format long
sqrt(2)
ans =
1.414213562373095
vpa(ans,100)
ans =
1.4142135623730950488016887242096980785696718753769480731766797379907324784621070
38850387534327641573
tan(pi/4)
ans =
1.000000000000000
tand(45)
ans =
1
log(2)
ans =
0.693147180559945
log10(2) log 10
ans =
0.301029995663981
isnan(0/0)
ans =
logical
isnan(1/0)
ans =
logical
k=physconst('Boltzman')
k =
1.380650400000000e-23
c=physconst("Lightspeed")
c =
299792458
R=physconst("EarthRadius")
R =
6371000
% roots of polynomial
p=[2 0 0 -1 0 0 1 -4] %2x^7-x^4+x-4=0
p =
2 0 0 -1 0 0 1 -4
roots(p)
ans =
-0.984679790975369 + 0.553047500894175i
-0.984679790975369 - 0.553047500894175i
-0.264344424686305 + 1.119223342047483i
-0.264344424686305 - 1.119223342047483i
1.121391663931368 + 0.000000000000000i
0.688328383695989 + 0.763875273691798i
0.688328383695989 - 0.763875273691798i
R=roots(p)
R =
-0.984679790975369 + 0.553047500894175i
-0.984679790975369 - 0.553047500894175i
-0.264344424686305 + 1.119223342047483i
-0.264344424686305 - 1.119223342047483i
1.121391663931368 + 0.000000000000000i
0.688328383695989 + 0.763875273691798i
0.688328383695989 - 0.763875273691798i
R(4)
ans =
-0.264344424686305 - 1.119223342047483i
who
R ans c k p
whos
Name Size Bytes Class Attributes
pwd
ans =
'/MATLAB Drive'
x =
1 4 9 16 25 36 49 64 81 100
(1)
ans =
x(2)
ans =
4
x(0)
Array indices must be positive integers or logical values.
Triangle numbers
n=1;
while n<=5
t(n)=n*(n+1)/2
n=n+1;
end
figure
cplxroot(5)
cplxroot Riemann surface for the n-th root.
cplxroot(n) renders the Riemann surface for the n-th root.