While循环Matlab中的指令
这条指令While循环Matlab中的指令,matlab,Matlab,这条指令vector=[vector,sum(othervector)]在matlab中的while循环中做了什么 vector=[]; while a - b ~= 0 othervector = sum(something') %returns a vector vector=[vector,sum(othervector)]; %it keeps a new vector? ... end vector=vector./100 执行a=[a,b]意味着将b附加到a,因
vector=[vector,sum(othervector)]
在matlab中的while循环中做了什么
vector=[];
while a - b ~= 0
othervector = sum(something') %returns a vector
vector=[vector,sum(othervector)]; %it keeps a new vector?
...
end
vector=vector./100
执行
a=[a,b]
意味着将b
附加到a
,因此向量
最终将成为一个矩阵,其中每列都是某物的行和
更具体地说:假设
某物“
是这个矩阵:
something' = [ 1, 2; 3, 4 ];
然后,sum(something')
是:
othervector = [ 3 ; 7 ]
othervector = [ 10; 11 ]
最初vector
是空的,因此这将vector
设置为
vector = [ 3 ; 7 ]
假设我们重复一个新的东西'
,由
[ 5, 5; 5, 6 ]
然后,sum(something')
是:
othervector = [ 3 ; 7 ]
othervector = [ 10; 11 ]
现在我们使用vector=[vector,sum(othervector)]
将其扩充为vector
:
执行
a=[a,b]
意味着将b
附加到a
,因此向量
最终将成为一个矩阵,其中每列都是某物的行和
更具体地说:假设
某物“
是这个矩阵:
something' = [ 1, 2; 3, 4 ];
然后,sum(something')
是:
othervector = [ 3 ; 7 ]
othervector = [ 10; 11 ]
最初vector
是空的,因此这将vector
设置为
vector = [ 3 ; 7 ]
假设我们重复一个新的东西'
,由
[ 5, 5; 5, 6 ]
然后,sum(something')
是:
othervector = [ 3 ; 7 ]
othervector = [ 10; 11 ]
现在我们使用vector=[vector,sum(othervector)]
将其扩充为vector
: