Scientists have created flags that can generate electrical energy using wind and solar power.