Add data from excel to existing materials.mat file

13 views Asked by At

I have an .xlsx file with spectral dispersion data(wavelength, n values, k values) for a material that I want to add to an existing material file with a .mat file ending. From the look of the .mat file, there is a list of materials with with [1x1 struct] for each material. Opening them in the variable editor leads to k, n, wavelength, and interp_flag. Each of the k, n, and wavelength have [1x700 double] next to them. How do I add my excel file date to this file? The excel data is in three columns with headers in the first 3 locations of the first row labeled wavelength, n, and k. I have the io package installed and loaded.

I have tried to use the io package and the xlsread command in the command window to get octave to even spit the data back out in the command window and got a bunch of errors in return. I know that the materials structure format should consist of substructures with the materials name as the substructure name. Each substructure should have three substructures names wavelength, k and n corresponding to the wavelength and the imaginary and real parts of the index of refraction. I have all this information in the excel file but am unsure how I can make these structures and substructures. Then finally, once I have the structure arrays how do I add them to the current materials.mat file?

0

There are 0 answers