Impot Matrix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-21 7: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 #size- Labels:
-
STM32-MatTarget
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-21 8: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.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-21 8: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 Thanks- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-21 9: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/
Up vote any posts that you find helpful, it shows what's working..
