How can i unwrap the phase of my plot?

17 ビュー (過去 30 日間)
Mitsos
Mitsos 2015 年 1 月 28 日
編集済み: Star Strider 2015 年 1 月 28 日
Hello Everyone, please can anyone help me with my code? It can be found attached.
After my code is compiled i get a phase vs temperature plot that is continuous while i want to have a sawtooth likewise behaviour at 360 degrees. Basically i want to be unwrapted at 360 degrees and even i tried the unwrap function i didnt get a result Thanks a lot in advance Dimitris

採用された回答

Star Strider
Star Strider 2015 年 1 月 28 日
編集済み: Star Strider 2015 年 1 月 28 日
You actually want to wrap it, if I understand you correctly. You can use the mod or rem functions (choose a version) to wrap it:
phs = [0:10:1440]; % ‘Unwrapped’ phase
phwrap = @(adeg) mod(adeg, 360+1E-8); % Wrap Phase (mod)
phwrap = @(adeg) rem(adeg, 360+1E-8); % Wrap Phase (rem)
wphas = phwrap(phs);
figure(1) % Plot The Result
plot(phs, wphas)
grid
If you want to ‘unwrap’ it, use the built-in MATLAB unwrap function.

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by