0% found this document useful (0 votes)
27K views6 pages

To Get Started, Select MATLAB Help or Demos From The Help Menu

This document contains MATLAB code that performs various calculations and plots functions. It includes examples of exponentiation, square root, sine, pi, variable assignment, plotting cosine and other functions, and solving a quadratic equation. Errors are displayed for undefined functions.

Uploaded by

David Canaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27K views6 pages

To Get Started, Select MATLAB Help or Demos From The Help Menu

This document contains MATLAB code that performs various calculations and plots functions. It includes examples of exponentiation, square root, sine, pi, variable assignment, plotting cosine and other functions, and solving a quadratic equation. Errors are displayed for undefined functions.

Uploaded by

David Canaza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

To get started, select MATLAB Help or Demos from the Help menu.

>> 5^6

ans =

15625

>> 5^3

ans =

125

>> sqr(4)
??? Undefined command/function 'sqr'.

>> sqrt(4)

ans =

2

>> sin(45)

ans =

0.8509

>> pi

ans =

3.1416

>> sin(pi/4)

ans =

0.7071

>> sqrt(2)/2

ans =

0.7071

>> a=sqrt(2)/2

a =

0.7071

>> a=
??? a=
|
Error: Incomplete or misformed expression or statement.

>> a

a =

0.7071

>> b=sin(pi/4)

b =

0.7071

>> c=5^3

c =

125

>> a+b+c

ans =

126.4142

>> esplot('cos(x)')
??? Undefined command/function 'esplot'.

>> ezplot('cos(x)')
>>
>>
>> eszlot('cos(x)')
??? Undefined command/function 'eszlot'.

>> ??? Undefined command/function 'esplot'.

>> ezplot('cos(x)')
>>
>>
>> eszlot('cos(x)')
??? Undefined command/function 'eszlot'.

>>
??? ??? Undefined command/function 'esplot'.
|
Error: Missing variable or function.

>>
>> esplot('cos(x)'),grid on
??? Undefined command/function 'esplot'.

>> ezplot('cos(x)'),grid on
>> ezplot('acos(x)'),grid on
>> ezplot('abs(x)'),grid on
>> ezplot('x^(1/3)'),grid on
>> help funcion

funcion.m not found.

Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.



>>>> esmesh('sqrt(x^2+y^2)')
??? Undefined command/function 'esmesh'.

>> ezmesh('sqrt(x^2+y^2)')
>> ezmesh('(x^2+y^2)*exp(x^2+y^2)')
>> ezmesh('(x^2+y^2)*exp(1-x^2+y^2)')
>> ezmesh('(x^2+y^2)*exp(1-x^2-y^2)')
>>
--- =
=/ ==

~




Para ecuacioncuadratica
disp('Ecuacion cuadratica')
disp('---------------------')
a=input('ingrese el coeficiente de a:');
b=input('ingrese el coeficiente de b:');
c=input('ingrese el coeficiente de c:');
if a~=0
d=b^2-4*a*c;
if d>0
x1=(-b+sqrt(d))/(2*a);
x2=(-b-sqrt(d))/(2*a);
fprintf('\nla raiz x1 es: %6.4f\nLa raiz x2 es: %6.4f\n\n',x1,x2)
else
if d==0
x1=-b/(2*a);
x2=x1;
disp(x1);
disp(x2);
else
disp('las raices son complejas')
end
end
else
disp('La ecuacion no es cuadratica');
end

You might also like