Easy!? When you know how. Thanks Samuel.
> -----Original Message----- > From: scilab.browseruk.bb30c473ec.sgougeon#[email protected] > Sent: Sat, 8 Apr 2017 11:37:44 +0200 > To: [email protected] > Subject: Re: [Scilab-users] SciLab euivalent of Perl's map() function? > (scilab: message 8 of 20) > > Hello, > > Le 08/04/2017 à 04:47, [email protected] a écrit : >> Hi, >> >> I want to do the equivalent of >> >> plot( xdata, xdata .^ 2, xdata .^ 3, xdata '^ 4, ... ); >> >> and benefit from the plot() color rotation, without having to repeat the >> equation. >> >> In Perl I might do (something like): >> >> plot( xdata, map xdata .^ $_, 2 .. 5 ); >> >> Something like that in SciLab? > > x = -2:0.1:2; > pw = [1 2 3 4]; > [X,P] = ndgrid(x, pw); > clf > plot(x, X.^P) > > xtitle("Power laws","x") > legend(msprintf("$x^%d$\n",pw'),4) > > HTH > Samuel _______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
