MATLAB演示6种常见的三角函数

 时间:2024-10-15 02:45:46

1、第一,输入以下代码,分别演示正弦sin( ),余弦cos( ),正切tan( ),余切cot( ),正割sec( ),余割csc( )六种常见的三角函数,其中定义域为0到4pi(未考虑pi/2,pi等时正切余切无意义即分母为0等情况)。close all; clear all; clct = 0:pi/30:4*pi;y_sin = sin(t); % 正弦函数y_cos = cos(t); % 余弦函数y_tan = tan(t); % 正切函数y_cot = cot(t); % 余切函数y_sec = sec(t); % 正割函数y_csc = csc(t); % 余割函数figure(1);plot(t,y_sin,'r-','LineWidth',3);figure(2);plot(t,y_cos,'g-','LineWidth',3);figure(3);plot(t,y_tan,'y-','LineWidth',3);figure(4);plot(t,y_cot,'b-','LineWidth',3);figure(5);plot(t,y_sec,'k-','LineWidth',3);figure(6);plot(t,y_csc,'c-','LineWidth',3);figure(7);plot(t,y_sin,'r-','LineWidth',3);hold onplot(t,y_cos,'g-','LineWidth',3);plot(t,y_tan,'y-','LineWidth',3);plot(t,y_cot,'b-','LineWidth',3);plot(t,y_sec,'k-','LineWidth',3);plot(t,y_csc,'c-','LineWidth',3);hold offlegend('sin','cos','tan','cot','sec','csc')xlabel('t');ylabel('y');

MATLAB演示6种常见的三角函数

3、第三,得到余弦cos( )函数图像如下。

MATLAB演示6种常见的三角函数

5、第五,得到余切cot( )函数图像如下。

MATLAB演示6种常见的三角函数

7、第七,得到余割csc( )函数图像如下。

MATLAB演示6种常见的三角函数
  • matlab中怎么定义函数
  • matlab中e怎么输入
  • MATLAB 三角函数的用法
  • 请教各位怎样用matlab定义一个分段函数
  • matlab中input函数使用方法和实例
  • 热门搜索
    英国旅游签证 四川九寨沟旅游 四川旅游图 太原周边旅游景点 东部华侨城旅游攻略 特种旅游 益阳旅游 奥地利旅游签证 山南旅游 去三亚旅游攻略