本文主要是介绍Matlab | Matlab从入门到放弃(2)——索引,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
博主github:https://github.com/MichaelBeechan
博主CSDN:https://blog.csdn.net/u011344545
代码下载:https://github.com/MichaelBeechan/Matlab-From-Zero-To-One
%% Time:2019.5.24
%% Function:数组索引 工作区变量 文本和字符
%% 数组索引
A = magic(4)
%{
A =16 2 3 135 11 10 89 7 6 124 14 15 1
%}A(4, 2) %A(8)%% 如果尝试在赋值语句右侧引用数组外部元素,MATLAB 会引发错误。
%test = A(4, 5)A(4, 5) = 17
%{
A =16 2 3 13 05 11 10 8 09 7 6 12 04 14 15 1 17
%}%% 冒号运算符
A(1:3,2)
A(3,:)B = 0:10:100%% 工作区变量
A = magic(4);
B = rand(3, 5, 2);
% whossave myfile.mat
% load myfile.mat%% 文本和字符 "'"转置
myText = '
这篇关于Matlab | Matlab从入门到放弃(2)——索引的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!