ejercicios1

Upload: oscar-galo

Post on 04-Nov-2015

220 views

Category:

Documents


0 download

DESCRIPTION

ejercicios de análisis numérico

TRANSCRIPT

>> 10,-7,25/3,-1/4,sqrt(73),nthroot(8,3),pi,-2*pi/3,exp(1),i,i^(1/5),'alumno','cuenta','ao'

ans =

10

ans =

-7

ans =

8.3333

ans =

-0.2500

ans =

8.5440

ans =

2

ans =

3.1416

ans =

-2.0944

ans =

2.7183

ans =

0 + 1.0000i

ans =

0.9511 + 0.3090i

ans =

alumno

ans =

cuenta

ans =

ao

>> x=sin(pi),y=cos(3*pi/2),t_1=tan(pi/4),senoinv=asin(1),t_2=tan(atan(sqrt(2))),n=1.3*10^3,imag=log(i),L=log10(sqrt(100))

x =

1.2246e-16

y =

-1.8370e-16

t_1 =

1.0000

senoinv =

1.5708

t_2 =

1.4142

n =

1300

imag =

0 + 1.5708i

L =

1

>> r=real(8-i),im=imag(8-i),pos=abs(nthroot(-pi^2,3)),nombre='Juan',sexo='m'

r =

8

Subscript indices must either be real positive integers or logicals. >> pos=abs(nthroot(-pi^2,3)),nombre='Juan',sexo='m'

pos =

2.1450

nombre =

Juan

sexo =

m

>> x=pi-1,p=nthroot(x,5)/4,expo=exp(nthroot(pi,5))-3

x =

2.1416

p =

0.2911

expo =

0.5158>> h=72,w=175,s=(0.1091)*(w^(0.425))*(h^(0.725))

h =

72

w =

175

s =

21.7612>> format rat>> frac=(7/8+5/4-(3/2)*4/9)/(5/2-11/10+1/14*7/5)

frac =

35/36 >> x=3*(cos(pi/3))^2-exp(3),y=abs(pi^2 - 4*log(7)),seg=nthroot(x/y,9)

x =

-19.3355

y =

2.0860

seg =

-1.2807>> s=1+i,H=(s^3 - 2*s +7)/(s^2 -6*s +3)

s =

1.0000 + 1.0000i

H =

-0.3600 + 0.4800i>> help char char Create character array (string). S = char(X) converts the array X that contains nonnegative integers representing character codes into a MATLAB character array (the first 127 codes are ASCII). The actual characters displayed depends on the character encoding scheme for a given font. The result for any elements of X outside the range from 0 to 65535 is not defined (and may vary from platform to platform). Use DOUBLE to convert a character array into its numeric codes. S = char(C), when C is a cell array of strings, places each element of C into the rows of the character array S. Use CELLSTR to convert back. S = char(T1,T2,T3,..) forms the character array S containing the text strings T1,T2,T3,... as rows. Automatically pads each string with blanks in order to form a valid matrix. Each text parameter, Ti, can itself be a character array. This allows the creation of arbitrarily large character arrays. Empty strings are significant. See also strings, double, cellstr, iscellstr, ischar.

Overloaded methods: opaque/char inline/char fittype/char codistributed/char junit/char cgtabgradconstraint/char cgsumobjective/char cgsumconstraint/char cgrangeconstraint/char cgprecpolyfix/char cgpreclookupfix/char cgprecfloat/char cgprec/char cgpointobjective/char cgpointconstraint/char cgoptimitem/char cgoppoint/char cgfuncmodel/char xregdesign/char des_constraints/char coninputfactor/char cgvariable/char cgsubexpr/char cgrelexpr/char cgnormfunction/char cgnormaliser/char cgmswitchexpr/char cgmodexpr/char cgminmaxexpr/char cglookuptwo/char cglookupone/char cgifexpr/char cgfuncexpr/char cgfeature/char cgexprconstraint/char cgexpr/char cgdivexpr/char cgconstraint/char cgconconstraint/char cgclipexpr/char xregvectorinput/char xregtextinput/char xregstepinput/char xregrangeinput/char xreglistctrl/char xregclicktolinput/char xregclickinput/char popupinput/char multiinput/char xregusermod/char xregunispline/char xregtwostage/char xregrbf/char xregnnet/char xregmulti/char xregmodswitch/char xregmodel/char xreglolimot/char xreginterprbf/char xreghybridrbf/char xregcubic/char xregcovariance/char xregarx/char xreg3xspline/char mbcinputfactor/char localusermod/char localtruncps/char localsurface/char localpspline/char localpoly/char localmulti/char localbspline/char localavfit/char sweepsetfilter/char sweepset/char categorical/char sym/char

Reference page in Help browser doc char

>> help double double Convert to double precision. double(X) returns the double precision value for X. If X is already a double precision array, double has no effect. double is called for the expressions in FOR, IF, and WHILE loops if the expression isn't already double precision. double should be overloaded for all objects where it makes sense to convert it into a double precision value. See also single, datatypes, isfloat, isnumeric.

Overloaded methods: opaque/double codistributed/double mfilt.double xregpointer/double xregusermod/double xregunispline/double xregtwostage/double xregnnet/double xregmultilin/double xregmodel/double xreglolimot/double xreglinear/double xregcovariance/double xregarx/double localusermod/double localtruncps/double localsurface/double localpspline/double localmulti/double localbspline/double localavfit/double sweepsetfilter/double sweepset/double StaticModel/double cvtest/double cvdata/double dataset/double categorical/double filtstates.double dfilt.double

Reference page in Help browser doc double

>> help date date Current date as date string. S = date returns a string containing the date in dd-mmm-yyyy format. See also now, clock, datenum.

Reference page in Help browser doc date

>> help rats rats Rational output. rats(X,LEN) uses RAT to display rational approximations to the elements of X. The string length for each element is LEN. The default is LEN = 13, which allows 6 elements in 78 spaces. Asterisks are used for elements which can't be printed in the allotted space, but which are not negligible compared to the other elements in X. The same algorithm, with the default LEN, is used internally by MATLAB for FORMAT RAT. Class support for input X: float: double, single See also format, rat.