I need to change a graphic without using unwrap
1 回表示 (過去 30 日間)
古いコメントを表示
Please I need a Matlab expert!!
I need this totally discontinuous graph to be transformed into a continuous graph like the one in the following figure, but without using the unwrap function that is built into Matlab. I need if you can guide me and show a code which will help me to achieve the continuity of the graph. It is very important not to use the unwrap function to achieve the goal. Thank you in advance
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1050375/image.png)
This is the graph or discontinuous function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1050380/image.png)
I need to get to this graph or function without using the unwrap function
0 件のコメント
回答 (1 件)
Jonas
2022 年 6 月 29 日
you can unwrap manually. if you have data x and y
myWrapThr=-150;
dy=diff(y);
dy(dy<myWrapThr)=dy(dy<myWrapThr)+180;
newY=cumsum([y(1) dy]);
2 件のコメント
Jonas
2022 年 6 月 30 日
your aim is to remove the jump from approx. +90 to -90. This would equal of exactly -180. depending on the last point before the jump and the first after, the values could also be +86 and -88, then the difference would be only -174. the vatch this natural unprecision, i use a threshold of -150. You could also use -175 as threshold or -170. So my choosing was very generous ;)
this jump values are the corrected by 180 to remove the jump and then the vector is reformed using cumsum on the differental dy
note two things: at the moment the given code only removes jumps near -180 and not +180. But the code can be easily adjusted or expanded for such behavior.
the other point is the unwrapping itself: normally unwrapping is used for visual phase jumps of signals, but those are normally between +-180, or 360 in absolute terms. phases of +- 180 are the equal, but +-90 are not
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!