Martix is getting updated with the value of e,Without adding a new column, Please help me.
1 view (last 30 days)
Show older comments
kintali narendra
on 2 Jun 2016
Commented: Walter Roberson
on 2 Jun 2016
persistent eWithDeltaL;
eWithDeltaL = [];
eWithDeltaL(end+1) = e;
0 Comments
Accepted Answer
Walter Roberson
on 2 Jun 2016
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 Comments
Walter Roberson
on 2 Jun 2016
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.
More Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!