フィルターのクリア

How to display polar form in GUI edit text?

2 ビュー (過去 30 日間)
ladybird
ladybird 2017 年 8 月 6 日
コメント済み: ladybird 2017 年 8 月 7 日
Hi, im new to GUI. I have a simple question.. How to display polar form in GUI edit text?
let say, a=4-2i
set(handles.edit_polar,'string',num2str(a))
so this will display 4-2in in the edit text.. but how to make it displayed in polar form? like this=>(4.47<-26.57) is it possible?
i know how to convert them into magnitude and angle, but how to display them in the gui edit text..
Thanks in advance... :)

採用された回答

Jan
Jan 2017 年 8 月 6 日
編集済み: Jan 2017 年 8 月 6 日
a = 4 - 2i;
s = sprintf('(%g %g)', abs(a), angle(a) * 180 / pi);
set(handles.edit_polar, 'string', s);
  1 件のコメント
ladybird
ladybird 2017 年 8 月 7 日
Hi Jan Simon,
Thank you, it works!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by