[Scilab-Dev] nested function works only with deff()

Erhy erhard.glueck.austria at gmail.com
Sun Mar 26 15:52:13 CEST 2017


Hello!
I tried the example in Help with Version 6.0.0
of datatipSetDisplay.
It works only after modification of the inserted nested function
with deff()

Now the code is:

function Tips= ShowTips()
x1=linspace(0,1,100)';
y1=x1.^3;
clf();
plot(x1,y1,x1,sinc(10*x1));
e=gce();
p1=e.children(1);//sinc(10*x1)
p2=e.children(2); //x1^3
t=datatipCreate(p1,50);
datatipSetOrientation(t,"lower right")
t=datatipCreate(p1,[0.8 0.5]);
t=datatipCreate(p2,[0.1,0.0]);
t=datatipCreate(p2,[0.8 0.4]);
datatipSetOrientation(t,"upper left")
deff( 'str=myfmt(h)', ..
	['pt = h.data;'; 'str = msprintf(''sinc\n%s'',
sci2exp(round(pt*10)/10));']);
pause
datatipSetDisplay(t,"myfmt")
Tips = "anything";
endfunction



--
View this message in context: http://mailinglists.scilab.org/nested-function-works-only-with-deff-tp4036017.html
Sent from the Scilab developers - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the dev mailing list