Problem in mishgrid and contour function
显示 更早的评论
I used to use mishgrid and contour function to draw the nonlinear dynamics in 2D map. However, lately something strange appears. Despite the difference in dynamics, the map drwan is always the same, which drives me mad. Has any one faced this problem before?
回答(1 个)
John D'Errico
2024-1-22
编辑:John D'Errico
2024-1-22
0 个投票
This is not even a probable user error. A CERTAIN user error.
You have done something wrong. Nobody knows what, since you have told us nothing useful to diagnose what you did. It may be that you have replaced some useful function with your own by mistake. Or, perhaps you have hard coded some lines of code that override whatever it is that you want to do when you change something. I could probably come up with a half dozen other reasons if pushed. But all of them would probably be wrong. So I cannot even guess what you did, since there are infinitely many ways of doing something wrong. And this means it is only you who can identify the problem.
LEARN TO USE THE DEBUGGER. Follow your code. Look at EVERY line, checking the validity of what it produces. Does something strange happen? Are you using the correct tool? At least the tool you think you are using there?
Effectively, what I am telling you to do is just good basic MATLAB programming practice. As you are learning to use the tool, you need to make sure you understand every line of code that you write. Execute ONE line of code at a time. Then look at what that single line of code did. Does it do what you expected? Does it do something strange? If it did something unexpected, spend some time to identify what is wrong, what is strange. If you cannot figure out the problem in a specific line of code, then ask a specific question on Answers, but only after reading the help for any functions called. Use due diligence before you ask a question that in hindsight, would have been answered had you only read the help first.
And, yes, I know this may not seem like a very useful answer. Lacking any code we can see, do you expect more? What you claim to see happening is indeed strange behavior, but it just means you did something wrong. So either post the complete code where someone might be able to help you, or do the work yourself. Honestly, it would be best if you learn to use the debugger, as then you will learn a huge amount, and earning to use the debugger effectively is one of the best things you can do for your own code.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!