Need help understanding error PLEASE
1 view (last 30 days)
Ameer Hamza on 27 Apr 2020
Edited: Ameer Hamza on 27 Apr 2020
You haven't attached the function fwithforcing(), so I cannot run your code, but I guess that sometimes the value of x(n) becomes negative, which causes an issue with axis() function. The limits in axis() should be in ascending order. Try to change it like this.
axis([sort([0 x(n)]) -Fmax Fmax]);
Note that you will need to change both calls to axis().