Say I want to do an array (vector) assignment, but the formula requires a conditional. Is there a better way to do it than:
b = ((a^2).*(a<5)) + ((a^0.5).*(a>=5)) which returns a^2 for a<5, and sqrt(a) for a>=5. And – just curious – if this is the only way, is the interpreter smart enough to not waste its time computing the false expression? Thanks, Michael Dunn | Editor-in-Chief Scope Junction | http://www.scopejunction.com/ (415) 947-6096 (USA) (519) 744-9395 (Canada) Skype: MichaelDunn_UBM LinkedIn: http://www.linkedin.com/in/cantares [cid:F5B559D4-7097-437C-B95F-49FE1D296AA9]<http://www.tech.ubm.com/>
<<inline: 0290B74A-5E6F-4D23-9C8D-ABE56804E06E[66].png>>
_______________________________________________ users mailing list [email protected] http://lists.scilab.org/mailman/listinfo/users
