Help: Convert MATLAB Data to C# for XNA Game

  • Context: MATLAB 
  • Thread starter Thread starter li4ngx
  • Start date Start date
  • Tags Tags
    Data Matlab
Click For Summary
SUMMARY

The discussion focuses on converting MATLAB data for use in a C# XNA game. The recommended approach is to utilize MATLAB's fprintf function to save data as a .txt file. This file can then be read and processed in C# using standard file I/O methods. This method ensures a straightforward transfer of data between MATLAB and C# for game controls.

PREREQUISITES
  • Familiarity with MATLAB programming and the fprintf function
  • Understanding of C# programming and file I/O operations
  • Basic knowledge of XNA game development framework
  • Experience with data formats, specifically .txt files
NEXT STEPS
  • Research MATLAB's fprintf function for data export
  • Explore C# file I/O techniques for reading text files
  • Learn about data handling in XNA for game controls
  • Investigate data serialization methods for more complex data structures
USEFUL FOR

Game developers, particularly those working with MATLAB and C#, who need to integrate MATLAB-generated data into XNA games.

li4ngx
Messages
1
Reaction score
0
matlab data to c# help!

hi,

i am trying to use data obtained from MATLAB as input for controls of a simple game in c# xna.

i am thinking of extracting the output from MATLAB as .txt file, which will be read and process by c#. Am I on the right direction, and how do I go about doing so?

Thanks in advance.

Regards.
 
Physics news on Phys.org


You can use fprintf to save to file in MATLAB and then use whatever file I/O is in C# to read the data in.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K