在matlab中调用函数时显示 Output argument "X_yun" (and maybe others) not assigned during call to

新手学堂043

在matlab中调用函数时显示 Output argument "X_yun" (and maybe others) not assigned during call to,第1张

有时候是因为函数里面设置的条件不满足,所以这个参数没有在函数中被赋值。也就说这个参数没有赋初值,也没有在函数里面后面的语句中赋值。因此,写函数的时候一定要保证无论在哪一个条件语句中,都要有相应的赋值语句,才能保证该参数一定有值返回。