Filter löschen
Filter löschen

I can't get to diplay values in a edit box. HELP!!!

1 Ansicht (letzte 30 Tage)
Saad Rana
Saad Rana am 2 Apr. 2020
Beantwortet: Rik am 2 Apr. 2020
Here is the full code
syms t n;
T=4
w0=2*pi/T
n=1:15
a0=(1/T)*int(1,t,0,2)
an=(2/T)*int(1*cos(n*w0*t),t,0,2)
bn=(2/T)*int(1*sin(n*w0*t),t,0,2)
set(handles.a0,'string',a0)
set(handles.an,'string',an)
set(handles.bn,'string',bn)
I want to diplay the values of a0, an and bn in edit boxes but for some reason it is giving error in these lines
set(handles.a0,'string',a0)
set(handles.an,'string',an)
set(handles.bn,'string',bn)

Akzeptierte Antwort

Rik
Rik am 2 Apr. 2020
It looks like you are trying to set a numeric value as the String property. You will first have to convert your symbolic values to char.
syms t n;
T=4;
w0=2*pi/T;
n=1:15;
a0=(1/T)*int(1,t,0,2);
an=(2/T)*int(1*cos(n*w0*t),t,0,2);
bn=(2/T)*int(1*sin(n*w0*t),t,0,2);
set(handles.a0,'string',char(a0))
set(handles.an,'string',char(an))
set(handles.bn,'string',char(bn))

Weitere Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by