table editing and excel export
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I don't know Matlab well yet and can't get any further.
I get from an analysis of a Matlab program the results as a table, which I want to edit in Matlab and export to Excel.
Time Value1 Value2 ...
1.0 27832.2 129819.2 ....
... ...
After the first line, I would now like to insert 2 more lines. One line should contain the unit and the second line should contain a comment (2 of the test parameters).
In addition, a variable is to be added after each heading ( Value1 - Sample1, Value2 - Sample1...).
The table is then to be exported into an Excel table. The name should consist of the experiment data ( Sample1_date.xls). The two variables are read in at the beginning of the program.
Then a second Excel table is to be exported in which the data of the Value1-Value10 columns are converted with a conversion factor.
Can anyone help me?
Sorry for my bad english, I hope it's understandable.
3 comentarios
dpb
el 22 de Nov. de 2019
Ayup. No can do that. MATLAB table variables are like regular variables--they must be consistent in type. The only way you can write numeric data together with non is to use a cell array to hold the content. That then will probably make using your resulting table difficult unless this is solely for display purposes.
Tell/Show us what you're really trying to accomplish as an end result and probably be able to get some better approaches.
Respuestas (1)
Image Analyst
el 22 de Nov. de 2019
I suggest you add the units in the column headers themselves, like
variableNames = {'Time_[sec]', 'Value1_Sample1_[kg]'};
1 comentario
dpb
el 22 de Nov. de 2019
There actually is a 'VariableUnits' property in the table object for exactly that purpose. As well as 'VariableDescriptions' and 'UserData' for additional identification.
It's unfortunate that the command window display of a table doesn't have a way to cause these to show up, though, you have to query their values (at least thru R2017b which is latest I've gotten around to installing here).
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!