SLM creates a special matrix in which each element is the same as its linear index.
I know, it's quite simple, but I find such a matrix is often useful during algorithm development. It has exactly the same calling index as <ones>, <rand> etc.
SLM(2,3) => [1 3 5 ; 2 4 6]
引用格式
Jos (10584) (2025). SLM (https://www.mathworks.com/matlabcentral/fileexchange/10031-slm), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2018b
兼容任何版本
平台兼容性
Windows macOS Linux类别
在 Help Center 和 MATLAB Answers 中查找有关 Linear Algebra 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!