要求用matlab把编程的步骤写在a4纸上就这五题,我知道都是基础的,没好好听,希望帮帮忙
Matlab自己一百度就好了
用什么语言写?题主得说明下
1.
A=[1,2,3;4,5,6]
2.
A=[1,2,3;1,1,1;];
B=[3,2;0,1;1,0];
A*B
3.
syms x;
f=((exp(x^3))-1)/(1-cos(sqrt(x-sin(x))));
limit( f,x,0 )
4.
A=[1,2,3;4,5,6];
b=A(2,2)
5.
y=dsolve('D2y+2Dy-3y=5*t','t')
以上每输入一个就按一次回车,最后就能得到值,别忘了如果要输入两行以上的话,在上面的每行后面加;。
参考答案:
clc,clear;
disp("问题1:")
A = [1 2 3;4 5 6]
disp("问题2:")
B = [1 2 3;1 1 1];
C = [3 2;0 1;1 0];
B*C
disp("问题3:")
syms x;
f = ((exp(x^3))-1)/(1-cos(sqrt(x-sin(x))));
limit(f,x,0,'right')
disp("问题4:")
b = A(2,2)
disp("问题5:")
syms y(t)
y = dsolve(diff(y,t,2)-2*diff(y)-3*y==5*t,'t')
运行结果:
问题1:
A =
1 2 3
4 5 6
问题2:
ans =
6 4
4 3
问题3:
ans =
12
问题4:
b =
5
问题5:
y =
C1*exp(-t) - (5*t)/3 + C2*exp(3*t) + 10/9
用在线版直接复制就可以运行:
不懂的函数可以参考官方文档:https://ww2.mathworks.cn/help/symbolic/sym.limit.html?s_tid=doc_ta
https://ww2.mathworks.cn/help/matlab/ref/diff.html?s_tid=doc_ta
https://ww2.mathworks.cn/help/symbolic/dsolve.html?s_tid=doc_ta
MATLAB的矩阵基础(附例题与代码)
https://blog.csdn.net/forest_LL/article/details/124144935