Change Lighting Skybox material unity5

Hi,

I want to change the Lighting Skybox with created materials in Assets/Materials folder via C# code at the beginning of loading. Here is the code that I’m using:

void Start () {
  Material skybox = RenderSettings.skybox;
  Material newMat = Resources.Load("matMed", typeof(Material)) as Material;
  RenderSettings.skybox = newMat;
}

But it shows only blue screen. If I assign the material to the lighting Skybox manually (by drag and drop) there is no problem.
Any help is appreciated
Thanks

I found the solution.

I created a new material before start function and assigned the Material from folder via Inspector to the material name and just called RenderSettings in the code. the final code is:

public Material newMat;
void Start () {
   RenderSettings.skybox = newMat;
 }

In my application, the code was attached to the main camera. When I created a new material, and save it, it doesn;t show immidiately when backed to the Unity. I switched from Camera to another GameObject and again clicked back to the camera to see the created material. Then dragged the material from folder and dropped on the newMat in the Inspector.