how to create contour with looping for each every data
1 回表示 (過去 30 日間)
古いコメントを表示
Dear all, I have several data ZA000060, ZA000120, ZA000180, ZA000240, and ZA000300. now I would to create contour for each data with looping. truthfully, I feel difficult to do that. any help would be great. Thanks alot
1 件のコメント
Stephen23
2016 年 4 月 14 日
編集済み: Stephen23
2019 年 6 月 27 日
" truthfully, I feel difficult to do that."
Yes, it is difficult.
The reason it is difficult is because you chose to store your data in separate variables. If you had put all of your data in just one variable then it is trivial top loop over it using indices (or fieldnames). This has already been explained to you in your earlier question:
and you even accepted an answer that put those data into one cell array. So you took a simple answer using a cell array and by removing the cell array made your own life much more complicated (because now you cannot access those variables very easily).
It really is that simple: using one variable solves your problem.
Bad program design makes difficult, slow, and buggy code. And by storing all of your data in separate variables you just made accessing those data more complicated that if you put them simply into one variable. No matter how many times beginners love to dream up the idea that they can access lots of variables dynamically, it is actually just slow, buggy, and obfuscated code.
Best solution: store your data in one variable, then use indexing or fieldnames to access it. This will be much much faster, neater, and more reliable than any hack solution you can find to access lots of variables.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!