How to "Pretty( )" output in GUI?

21 次查看(过去 30 天)
Hello all, I am working on my assignment and I have created a GUI in Matlab one part of which takes user input (tag:inputfun) and integrates it and its working perfectly but I want that output to be as we write on paper i.e. in the form of "Pretty( )" so that user can easily understand. I tried a lot but I was unable to do that. Can anyone please help me so that I can submit my assignment as soon as possible. Hoping for Answer :)

采纳的回答

Walter Roberson
Walter Roberson 2014-1-22
outstr = evalc(pretty(c));
Remember to make handles.answers something that is fixed-width font (not proportional.) If it is a uicontrol 'text' or 'edit' box, make sure that its Max property is set to at least 2.
You might also need to use
outstrcell = regexp( outstr, '\n', 'split' );
and use that as your String
  5 个评论
Walter Roberson
Walter Roberson 2014-1-28
编辑:Walter Roberson 2014-1-28
b=get(handles.inputfun,'string');
c=int(sym(b));
outstr = evalc('pretty(c)');
set(handles.answer,'string',outstr)
Albert  Shesman
Albert Shesman 2014-1-29
编辑:Albert Shesman 2014-1-29
Thaaaaaaaaaaaaaaaaaaaannkuuu Soooooooooooooooooo Much sirrrrr Really People here are very helpful :) Thank You Again Sir GOD BLESS YOUUUUUUUU..

请先登录,再进行评论。

更多回答(3 个)

Image Analyst
Image Analyst 2014-1-22
I never heard of Petty(), but you can click anywhere in the editor window and type control-a followed by control-i to fix the indenting. If you highlight a section of code, it will fix up that highlighted section only.
  6 个评论
Image Analyst
Image Analyst 2014-1-28
You still didn't list it in the Products section, so I did it for you.
Albert  Shesman
Albert Shesman 2014-1-29
oops sorry :p.. and thaaannkuu to you tooo thanku sir :)

请先登录,再进行评论。


Abdul Goffar
Abdul Goffar 2014-12-10
I got same trouble with you, but its't not solved yet. This is the error messages I got. Could you please help me fix it?
??? Error using ==> evalc
Undefined function or method 'pretty' for input arguments of type 'char'.
Error in ==> contoh>pushbutton3_Callback at 129
outstr=evalc('pretty(y)');

Abdul Goffar
Abdul Goffar 2014-12-10
sorry... I was just solved it.. Thx so much :))

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by