2013-10-21 07:33 AM
Hello,
I want to import a Matrix which his size is 140*200 to my program. This matrix is create by MATLAB (file format .mat) i can copy it to txt file. How can i call in main program to be useful after ? have I to separate the row and column by space or ; I'm using STM32F4 Thanks you ^_^ #matrix #matlab #stm2f4 #size2013-10-21 08:01 AM
I'd suggest you write a small C app, or script (AWK, Pearl, etc), and process that table into a ''C'' format that you can #include into your compilation.
int MyTable[10][10] = { { 1, 2, 3, .. }, .. , { .. } }; Alternatively if you have some file storage (SD Card, FatFs, NAND), you could store the text output from MatLab as a file, and simply parse that data into a structure/table at run time.2013-10-21 08:29 AM
My table have a big size, i can't write it manually, i found a function called fopen but i didn't know how to use it
some components of table are: 523 528 536 496 452 439 433 439 ............................. 200 column 250 658 025 ............................................ .................................. 140 Row Thanks2013-10-21 09:12 AM
My table have a big size, i can't write it manually, i found a function called fopen but i didn't know how to use it
Yeah, I'd class the app/script method as ''mechanical''. The STDIO and fopen/fread/fclose, and file handling concepts are pretty fundamental CS stuff. Try this, or Google for some others.http://www.cs.bu.edu/teaching/c/file-io/intro/