Preheat oven to 350°F (175°C). Grease and flour a 9×13-inch baking pan.
In a large bowl, whisk together flour, baking powder, baking soda, salt, cinnamon, and nutmeg.
In another bowl, whisk vegetable oil, granulated sugar, brown sugar, eggs, and vanilla extract until smooth.
Gradually add dry ingredients to the wet ingredients, mixing until just combined. Fold in grated carrots, zucchini, and walnuts (if using).
Pour batter into the prepared baking pan, smoothing the top. Bake for 35–40 minutes, or until a toothpick inserted in the center comes out clean. Cool completely in the pan on a wire rack.
For the frosting, beat softened cream cheese and butter in a medium bowl until creamy. Gradually add powdered sugar and vanilla extract, beating until fluffy.
Spread cream cheese frosting over the cooled cake. Garnish with chopped walnuts, if desired. Slice into squares and serve.