MATLAB 练习台
% ===== 试试运行 ===== % 解一个线性方程组 A = [1 2 3; 4 5 6; 7 8 10]; b = [6; 15; 25]; x = A \ b; disp('方程 Ax = b 的解 x ='); disp(x); % 画一个正弦/余弦波 t = linspace(0, 2*pi, 200); figure(1); plot(t, sin(t), 'LineWidth', 2); hold on; plot(t, cos(t), 'LineWidth', 2); title('sin 与 cos'); legend('sin(t)', 'cos(t)'); grid on;
▶ 运行
清空
Ctrl/Cmd + Enter 也可运行
输出
(还没有运行结果)
图形