Matlab 如果 x = 0×1 空双列向量

问题描述 投票:0回答:1

正确的语法是什么

if x = 0×1 empty double column vector

x = 5

end

我试过这个:

if x == [] 

x = 5

end

但它似乎不起作用,我不知道还能怎么做。

换句话说,当我尝试将 x 写入某物时,我收到此错误消息:

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.
,所以我尝试实现一些使 x 为零而不是空的东西。

matlab if-statement is-empty
1个回答
0
投票

来自@crisluengo

如果为空(x)

© www.soinside.com 2019 - 2024. All rights reserved.