matlab : R2018a 64bit
OS : Windows 10 x64
typesetting : Markdown
blog : my.oschina.net/zhichengjiu
gitee : gitee.com/zhichengjiugit
clear clc eye(3)*3 % 幾階乘幾
ans = 3 0 0 0 3 0 0 0 3 >>
clear clc eye(3) eye(3,2)
ans = 1 0 0 0 1 0 0 0 1 ans = 1 0 0 1 0 0 >>
clear clc a=[1,2,3]; diag(a) diag(a,1) % 上移一個單位 diag(a,2) % 上移兩個單位 diag(a,-1) % 下移一個單位
ans = 1 0 0 0 2 0 0 0 3 ans = 0 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 ans = 0 0 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 ans = 0 0 0 0 1 0 0 0 0 2 0 0 0 0 3 0 >>
clear clc a=vander([1; 2; 3; 4 ;5]) % 有沒有分號同樣的 b=vander([1:0.5:3]) % 有規律的從右向左數第二列
a = 1 1 1 1 1 16 8 4 2 1 81 27 9 3 1 256 64 16 4 1 625 125 25 5 1 b = 1.0000 1.0000 1.0000 1.0000 1.0000 5.0625 3.3750 2.2500 1.5000 1.0000 16.0000 8.0000 4.0000 2.0000 1.0000 39.0625 15.6250 6.2500 2.5000 1.0000 81.0000 27.0000 9.0000 3.0000 1.0000 >>
clear clc a=[1:0.2:3;5:0.2:7] % 間隔0.2 起始值1 終值3
a = 1.0000 1.2000 1.4000 1.6000 1.8000 2.0000 2.2000 2.4000 2.6000 2.8000 3.0000 5.0000 5.2000 5.4000 5.6000 5.8000 6.0000 6.2000 6.4000 6.6000 6.8000 7.0000 >>
感謝幫助 志成就 的人們。
matlab優秀,值得學習。基礎知識 + 專業知識 + matlab = ?
Simulink,用於仿真和基於模型的設計,值得學習。
該博文僅可用於測試與參考。學習