Hello everybody,
I would like to write some data to a text-file. Unfortunately the dimensions of the data are not the same, so I get the error:
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
Filename_txt = 'Dummy.txt' data = [Angle Velocity Distance Acceleration]'; fidwrite = fopen(Filename_txt, 'wb'); fprintf(fidwrite, '%s\t %s\t %s\t %s\n', 'Angle[deg]','Velocity[mm/s]','Distance [mm]', 'Acceleration [mm/s^2]'); status = fprintf(fidwrite, '%4.5f\t %4.5f\t %4f.5\t %4.5f\n', data); fclose(fidwrite); disp (['txt-File ' Filename_txt ' created']);
Is it possible to write the data into one text-file even though they differ in their dimensions?
Thank you
Christian
Best Answer