Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
While循环Matlab中的指令_Matlab - Fatal编程技术网

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