OpenFAST / matlab-toolbox

Collection of Matlab tools developed for use with OpenFAST
Apache License 2.0
50 stars 68 forks source link

xlmwrite in campbell_diagram_data function fails on Mac OS #17

Closed ramisetti closed 3 years ago

ramisetti commented 4 years ago

The use of xlmwrite inside the campbell_diagram_data function to generate the excel sheet is not working on Mac OS. xlmwrite function works for Windows OS and may be Linux OS. Instead writetable function can be used but the cell data should be first converted to table data. I think this problem can be avoided if a flag is used to check OS type and accordingly call appropriate function, either xlmwrite or writetable, to write the excel sheet.

ebranlard commented 4 years ago

I'm using a function I wrote to write this to a csv file instead. Let me know if that works for you, I'll likely send a pull request later.

https://github.com/ebranlard/matlab-toolbox/blob/master/MBC/Source/csvwriteCampbell.m

ramisetti commented 4 years ago

Yes it works for me now. I think xlmwrite may be replaced with this csvwriteCampbell function used in the campbell_diagram_data function as this can work on any OS. Before you make the pull request, please make sure your fprintf statements do not output data to the screen as it is not required here.

However, I think csvwriteCampbell function is not really helpful to replace xlmwrite inside runCampbell.m where multiple spreadsheets are being written to a single file.