12.02.2014 Aufrufe

Mathematik für Physiker - Numerische Physik: Modellierung

Mathematik für Physiker - Numerische Physik: Modellierung

Mathematik für Physiker - Numerische Physik: Modellierung

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

502 ANHANG B. MATLAB: THE BASICS<br />

dxPos = [0.1 0 0 0];<br />

xrange=2*pi;yrange=2*pi;<br />

hText = uicontrol( ...<br />

’Style’,’edit’, ...<br />

’Units’,’normalized’, ...<br />

’Position’,Pos, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’String’,’sin(x/2)*cos(y)’);<br />

uicontrol( ...<br />

’Style’,’text’, ...<br />

’Units’,’normalized’, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’Position’,Pos+1*dPos, ...<br />

’HorizontalAlignment’,’left’, ...<br />

’String’,’+/- x’);<br />

xcb = [...<br />

’xrange = str2num(get(hxrange,’’String’’))’];<br />

hxrange = uicontrol( ...<br />

’Style’,’edit’, ...<br />

’Units’,’normalized’, ...<br />

’Position’,Poshalbe+1*dPos+1*dxPos, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’String’,’2*pi’, ...<br />

’Callback’,xcb);<br />

uicontrol( ...<br />

’Style’,’text’, ...<br />

’Units’,’normalized’, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’Position’,Pos+2*dPos, ...<br />

’HorizontalAlignment’,’left’, ...<br />

’String’,’+/- y’);<br />

ycb = [...<br />

’yrange = str2num(get(hyrange,’’String’’))’];<br />

hyrange = uicontrol( ...<br />

’Style’,’edit’, ...<br />

’Units’,’normalized’, ...<br />

’Position’,Poshalbe+2*dPos+1*dxPos, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’String’,’2*pi’, ...<br />

’Callback’,ycb);<br />

hplot = uicontrol(...<br />

’Style’, ’popup’,...<br />

’Units’,’normalized’, ...<br />

’BackgroundColor’,[1 1 1], ...<br />

’String’, ’ezsurf|ezsurfc|ezmesh|ezmeshc|contour’,...<br />

’Position’, Pos + 4*dPos,...<br />

’Callback’, ’setplot’);<br />

Sub: setplot<br />

val = get(hplot,’Value’);<br />

funk = get(hText,’String’);<br />

if val == 1<br />

ezsurf(funk,[-xrange xrange -yrange yrange]);<br />

elseif val == 2<br />

ezsurfc(funk,[-xrange xrange -yrange yrange]);<br />

elseif val == 3<br />

ezmesh(funk,[-xrange xrange -yrange yrange]);<br />

elseif val == 4<br />

ezmeshc(funk,[-xrange xrange -yrange yrange]);<br />

elseif val==5<br />

ezcontour(funk,[-xrange xrange -yrange yrange]);<br />

end<br />

13. März 2007 c○ M.-B. Kallenrode

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!