MATLAB Creating an M-file for Fraternity GPA Calculations with MATLAB

  • Thread starter Thread starter Jamin2112
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
The discussion focuses on creating an M-file in MATLAB to manage and analyze GPA and credit data for fraternity members. The user has set up a vector of structures to store individual member information, including a "name" field for GPA input. However, they are encountering issues with manual data entry in MATLAB. Suggestions include using Excel to input data, as it simplifies the process and allows for easier data management. Once the data is organized in Excel or a CSV format, it can be imported into MATLAB for more advanced calculations. Additionally, formatting code properly using designated tags is recommended for clarity in future posts.
Jamin2112
Messages
973
Reaction score
12
So I'm trying to make an M-file that takes all the credits and GPA's from every member in my fraternity (I'll type them in manually), then does a bunch of calculations on them.

So far I've created a vector of structures, each structure referring to a person in the house. Each structure will have a field called "name" so that I know where to input each person's GPA once grades are released. Anyways, you might be able to tell from below. I'm trying to figure out how to input each person credits and GPA. I just put a little example of what I'm trying to do for one person on rows 12 and 13. However, it isn't working. Could I get some help?


screen-capture-41.png
 
Physics news on Phys.org
Manual data entry isn't exactly MATLAB's forte: if you use Excel and save as a .csv (comma separated values) or just a plain jane .xls or .xlsx, it'd be a whole lot easier and more portable. Actually, for what you're trying to do (basic stats), you can probably do it all in Excel.

That said, once you've got an Excel spreadsheet (or a .csv) you can import it into MATLAB if you're doing fancier stuff using a variety of functions:
http://www.mathworks.com/help/techdoc/import_export/br5s7ig.html

Also for future reference, put your code between
Code:
 and [ /code] tags (no space in the second tag) to keep formatting and make things pretty, instead of using a screen grab.
 
Last edited by a moderator:

Similar threads

Replies
7
Views
8K
Replies
5
Views
8K
Replies
4
Views
2K
Replies
1
Views
2K
Replies
5
Views
1K
Replies
3
Views
3K
Replies
4
Views
3K
Back
Top