The Duke of Edinburgh joked that he "can't stand up much longer" as he undertook his first royal engagement since his retirement was announced.