Quantcast
Channel: PatternTest in Function - Mathematica Stack Exchange
Browsing latest articles
Browse All 2 View Live

Answer by eldo for PatternTest in Function

h = If[NumericQ[#], #^2, HoldForm[h][#]] &;h /@ {3, a}{9, h[a]}g = If[NumericQ[#], Function[x, x^2][#], HoldForm[g][#]] &;g /@ {3, a}{9, g[a]}

View Article



PatternTest in Function

This is probably trivial and already asked but I did not find it.How to use PatternTest inside Function (g) or in pure function (h) so that it provides the same result as f?Clear[f, g, h,...

View Article
Browsing latest articles
Browse All 2 View Live




Latest Images