Quantcast
Channel: Pattern matching and HoldForm - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 2

Pattern matching and HoldForm

$
0
0

Create rules based on data.I have a system that picks out on date,based on some rules. I then want to generate a new rule based on this date and apply the rule to a new dataset.

datePicked={{2008, 3, 21, 0, 0, 0.}}rule=datePicked/. {t_, n_, o_, b___} :> HoldForm[{t, n, v_, b} /; v <= o];d=DateRange[{2008, 2, 21, 0, 0, 0.`}, {2008, 3, 21, 0, 0, 0.`}]Cases[d,#]&@@rule

Problem is that the rule I have made is not general, it has assigned the $ to v. How can I make it general?


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>