text=tf([1 1 1 1 1],[2 2 2 2 2 2 2]);
set(handles.text1,'Value',text);
but that doesn't work. I changed 'Value' to 'string' but that also doesn't work.
anyone has any ideas?
thanks in Advance
Use EVALC to capture the display of the transfer function, and set the
String property of that text box to contain EVALC's output.
--
Steve Lord
sl...@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> Use EVALC to capture the display of the transfer function, and set the
> String property of that text box to contain EVALC's output.
>
Thanks a lot! I'm glad to know that it's possible. However with my limited Matlab skills I don't seem to get it right.
So I tried:
k=tf([1 1 1 1 1],[2 2 2 2 2 2 2]);
T=EVALC(k);
set(handles.text1,'String',T);
but that doesn't work.
When I tried it in the command window without the set-instruction it just gave me error saying: ??? Undefined function or method 'EVALC' for input arguments of type 'tf'.
I'm thinking it has something to do with capturing the "display" of the transfer function and not the thing itself. But I don't really know what you mean by that.
Could you please elaborate and tell me what I'm doing wrong?
> k=tf([1 1 1 1 1],[2 2 2 2 2 2 2]);
> T=evalc('k');
T will be the string which is the display of the variable k
Hope that helps.
-craig
"RobuLAB " <amaur...@etu.u-bordeaux1.fr> wrote in message
news:hsrlv1$pkp$1...@fred.mathworks.com...
Thx for your help
"Craig Buhr" <cb...@mathworks.com> wrote in message <hsubdm$84r$1...@fred.mathworks.com>...
> > > *************************
> It really work...thanks guys
> num=[R];
> den=[1 2];
> sys=tf(num,den)
> T=evalc('sys');
> set(handles.text1,'String',T);
> *******************************
I'm sorry, I don't know what I did wrong last time but it really does work now. I probably should do a little more trying before I state that something doesn't work.
Anyway I'm not going to use it since I found a way that gives me a little more control over what's printed and how.
e.g.:
My assignment is to specifically have 8 decimal digits so I adapted some code to be able to show all of those digits.
Since I'm using discrete-time transfer functions I have my sampling time printed when using evalc. I don't really need nor want that.
If anyone is interested, I'm willing to put the code here but I have to say that most of it isn't my work. I found some usefull code on the internet and adapted it to my needs.
for example I want to display following results in Edit text :
Number of station= 2
Number of Observation= 21
Adjusted coordinates
X y
100.01 11.09
111 23.78
Covariance Matrix
1
4
6
5
11
9
I have all these result from my function in GUI and I want to display them in Edit text and then save them in text file.
tnx