MATLAB揭秘--第五章习题

编程入门 行业动态 更新时间:2024-10-22 21:44:07

MATLAB揭秘--<a href=https://www.elefans.com/category/jswz/34/1668470.html style=第五章习题"/>

MATLAB揭秘--第五章习题

  • 1
octave:7> s = 7*sqrt(2)-5*sqrt(60)+5*sqrt(8)
s = -14.688
  • 2
octave:9> syms x;
octave:10> q = 3*x.^2+2*x;
octave:11> s = solve(q==7)
s = (sym 2×1 matrix)⎡  1   √22⎤⎢- ─ + ───⎥⎢  3    3 ⎥⎢         ⎥⎢  √22   1⎥⎢- ─── - ─⎥⎣   3    3⎦
  • 3
octave:15> syms x;
octave:16> q = x.^2+sqrt(5)*x-pi;
octave:17> s = solve(q)
s = (sym 2×1 matrix)⎡         _________⎤⎢  √5   ╲╱ 5 + 4⋅π ⎥⎢- ── + ───────────⎥⎢  2         2     ⎥⎢                  ⎥⎢    _________     ⎥⎢  ╲╱ 5 + 4⋅π    √5⎥⎢- ─────────── - ──⎥⎣       2        2 ⎦
  • 4
octave:19> syms x;
octave:20> q = sqrt(2*x-4);
octave:21> s = solve(q==1)
s = (sym) 5/2
  • 5
octave:23> clear
octave:24> syms t;
octave:25> q = 2*t.^3-t.^2+4*t-6;
octave:26> s = solve(q)
s = (sym 3×1 matrix)⎡                     _____________                                    ⎤⎢1   ⎛  1   √3⋅ⅈ⎞    ╱ 289   √2658                    23               ⎥⎢─ + ⎜- ─ - ────⎟⋅3 ╱  ─── + ─────  - ─────────────────────────────────⎥⎢6   ⎝  2    2  ⎠ ╲╱   216     36                         _____________⎥⎢                                        ⎛  1   √3⋅ⅈ⎞    ╱ 289   √2658 ⎥⎢                                     36⋅⎜- ─ - ────⎟⋅3 ╱  ─── + ───── ⎥⎢                                        ⎝  2    2  ⎠ ╲╱   216     36  ⎥⎢                                                                      ⎥⎢                                                         _____________⎥⎢1                   23                  ⎛  1   √3⋅ⅈ⎞    ╱ 289   √2658 ⎥⎢─ - ───────────────────────────────── + ⎜- ─ + ────⎟⋅3 ╱  ─── + ───── ⎥⎢6                       _____________   ⎝  2    2  ⎠ ╲╱   216     36  ⎥⎢       ⎛  1   √3⋅ⅈ⎞    ╱ 289   √2658                                  ⎥⎢    36⋅⎜- ─ + ────⎟⋅3 ╱  ─── + ─────                                  ⎥⎢       ⎝  2    2  ⎠ ╲╱   216     36                                   ⎥⎢                                                                      ⎥⎢                                             _____________            ⎥⎢                       23            1      ╱ 289   √2658             ⎥⎢            - ──────────────────── + ─ + 3 ╱  ─── + ─────             ⎥⎢                     _____________   6   ╲╱   216     36              ⎥⎢                    ╱ 289   √2658                                     ⎥⎢              36⋅3 ╱  ─── + ─────                                     ⎥⎣                 ╲╱   216     36                                      ⎦
  • 6
octave:29> clear
octave:30> syms x y z;
octave:31> a = x-3*y-2*z;
octave:32> b = 2*x-4*y-3*z;
octave:33> c = -3*x+6*y+8*z;
octave:34> s = solve(a==6,b==8,c==-5)
s =scalar structure containing the fields:x =<class sym>y =<class sym>z =<class sym>
octave:35> x = s.x,y = s.y,z = s.z
x = (sym) 1
y = (sym) -3
z = (sym) 2
  • 7
>> syms x;
>> q = exp(x)-x.^2;
>> s = solve(q==0) 
s = -2*lambertw(0, -1/2)-2*lambertw(0, 1/2) 
>> double(s)
ans =1.5880 - 1.5402i-0.7035 + 0.0000i
  • 8
>> syms x;
>> q = tan(x).^2-sec(x).^2;
>> s = simplify(q) 
s = 
-1
  • 9
>> syms x;
>> q = taylor(tan(x),10)
q = 
x + x^3/3 + (2*x^5)/15 + (17*x^7)/315 + (62*x^9)/283
  • 10
    刚刚电脑突然卡死,MATLAB的数据也丢失了,就用网上的在线编辑器弄出了答案:
octave:37> clear
octave:38> syms x;
octave:39> q = 4/(5-cos(x));
octave:40> s = taylor(q,'order',10,'expansionpoint',0)
s = (sym)8        6      4    2    241⋅x    113⋅x    5⋅x    x     ────── - ────── + ──── - ── + 1258048   23040    192    8     

更多推荐

MATLAB揭秘--第五章习题

本文发布于:2023-07-27 22:09:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1226529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:第五章   习题   MATLAB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!