Below is my code to write some data into Excel:
T1 = table(Cruise, Station_no, Lon, Lat, Year, Month, Day, Time, Pressure, Depth);
writetable(T1, ['outputs/', app.FileName.Value,'.xlsx'])
The code works, but the format of the data inside the generated Excel file is kind of messy. Here are what I hope the generated Excel file will look like:
(a) The Longitude and latitude columns should be displayed in a format like %.4f. I do not want to trim any decimal digits off, because the precision of the data is important. All I want is to set up the display format. This is similar to the acton of clicking "Format cells" and then setting up the decial places inside Excel.
(b) Similarly, I want the pressure and depth columns to be formated like %.2f.
(c) All columns should be centered.
Is this even possible using Matlab writetable?