Martix is getting updated with the value of e,Without adding a new column, Please help me.
1 次查看(过去 30 天)
显示 更早的评论
persistent eWithDeltaL;
eWithDeltaL = [];
eWithDeltaL(end+1) = e;
0 个评论
采纳的回答
Walter Roberson
2016-6-2
You are overwriting eWithDeltaL with [] every time. You should have the assignment of [] to the variable only when you know that you want to reset the variable.
2 个评论
Walter Roberson
2016-6-2
When you declare a variable as persistent, it is automatically assigned [] if it does not already exist. You do not need to initialize it to [] unless you want to reset it.
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!