登录论坛

查看完整版本 : 运行Matlab代码后数组不可用


poster
2019-11-28, 17:20
当我运行以下代码时,vf的值将在每个迭代步骤中打印出来。但是在代码完全完成之后,当我键入plot(vf)时,我得到了错误:

Unrecognized function or variable 'vf'. 这是我的代码:

global Y global vf vf=[]; c=0; for i=0:100:500 c=c+1; %%this is a function by which I read the data for Y readdata(i); vf(cnt) = mean(mean(Y .* Y)) end 有人可以帮我解决这个问题吗?



更多&回答... (https://stackoverflow.com/q/59078796)