MATLAB MATLAB Code For Analyzing Experimental Data

  • Thread starter person123
  • Start date
171
24
Summary
I'm in the process of writing MATLAB code to analyze data and I'm interested in how useful it would be for more general purposes.
Hi! I'm working on MATLAB code to analyze dat for a specific project, but I'm curious if it could made useful for more general purposes. Here's a bit of background on the project:

I'm an REU student and I was assigned to analyze data for a recently conducted experiment. The experiment took place in the wave basin at Hinsdale Wave Research Laboratory. Two wooden model houses were in the basin and impacted by waves until they broke. There were pressure gauges and load cells to measure uplift, accelerometers to determine the structural response of the building, ADVs, and wave gauges to measure water depth. Currently however, I have not analyzed accelerometer and ADV data. While analyzing data, I made it more and more automated until it became a sort of rudimentary program. Currently it can do the following (the idea being that if it were to be generalized, the user could write code to add more functions):

  1. A GUI is used to make it more user friendly.
  2. It can create plots comparing parameters. The title, labels, and legend title (the legend values are automatically generated based on a third parameter) are automatically generated.
  3. It has a constants class in which constants can be added. These include physical constants (g and water density for me), dimensions (of the house and sensor coordinates for me), the directories everything should be saved (more on that next), and the data which I extracted from the raw data (more on that in 7).
  4. It can automatically save figures in the proper folder and update the figures in a PowerPoint. I haven't gotten around to making it update a Word document, but a quick check online makes me think it's similar to updating a PowerPoint.
  5. It can automatically produce graphs from the raw data (original data, phase averaged or Fourier transform).
  6. It can automatically produce some other graphs more specific for me:
    1. Scatter plot comparing wave heights with and without house in basin.
    2. Animation of pressure gauge readings.
    3. Phase average of uplift and moment on building. A function computes the uplift and moment based on the pressure gauges (for the load cells it's easier of course).
    4. A comparison of two methods for computing uplift and moment from pressure gauges (using a linear regression and tributary areas for each gauge).
    5. A bar graph for comparing standard deviation across length of house versus along width (to see if it's fair to assume that pressure doesn't vary along width of house).
  7. It can automatically generate data based on the raw data. For me, this includes:
    1. Wave height for different trials (from wave gauge readings).
    2. Standard deviations for pressure gauges (mainly used for bar graph).
    3. Uplifts and moments for houses
I started thinking this could be made more general. The functions and constants I have could be the built-in ones, but then the user could create more things in MATLAB (new constants, new types of graphs, new data to extract from the raw data etc.) They could then use the GUI with those user-defined additions.

Is this a reasonable idea? Would it be useful for projects outside of the one I'm specifically doing? At the moment, I don't really have time to work on it if it isn't applicable to my specific assignment, but I would be definitely interested in continuing to work on it after summer if it would be a feasible idea.

Thanks in advance!
 
Last edited:

anorlunda

Mentor
Insights Author
Gold Member
7,301
4,071
There is a long tradition of productivity tools arising from people automating their own work. Think of text editors and word processors as a prominent example.

But because it is so common, it is likely that there are many other packages out there that do similar things. Think of text editors again. So the better question is not absolute feasibility but relative feasibility.

If you want to develop it as a commercial product, or even an open source project, I think your next step is research on what products and projects already exist. Open source projects generally have a discussion forum associates, so you could post your ideas there and ask for reactions.

But even if you don't get others using it, there can be the joy of creativity continuing development for your own use. Think of text editors for a third time. No matter how many editors we have, it is great fun to make your own from scratch. Because of that, I expect to see new editors appearing perpetually.
 
171
24
Thanks very much for the response! Honestly, I didn't even consider making it a commercial project a possibility; I was thinking of maybe uploading it to GitHub and that's about it. I have finished writing a very crude version of the program. The interface is very basic, but you are able to make custom constants, custom parameters and your own types of graphs. It works around a class which has Constant properties and methods for creating parameters; the user can then change the class itself to add more (it is designed to minimize the amount they would have to do). They can also open a template function in which they can write code to create their own type of graph, and other code inside the template integrates it with the rest of the program. I don't think I'm going to add much more now, because I'm really just using for myself though. I'm also generally discouraged from working on it, which is fair enough considering they need me to work on one specific task now, and they really have no reason to think I'm particularly good at coding (I have very little actual experience).
 

FactChecker

Science Advisor
Gold Member
2018 Award
5,048
1,773
You are right. There are large corporate groups that have most of their tools and analysis done in MATLAB code. There are also extensions to do simulations (Simulink), generate C-language code for real-time embedded programs, perform data analysis, etc. The extensions can be expensive. MATLAB is a major player in the engineering analysis world.
 
171
24
You are right. There are large corporate groups that have most of their tools and analysis done in MATLAB code. There are also extensions to do simulations (Simulink), generate C-language code for real-time embedded programs, perform data analysis, etc. The extensions can be expensive. MATLAB is a major player in the engineering analysis world.
That actually sounds amazing because if people are paying for things like this, I would imagine it would be useful to people if I were to opensource it -- would it? (Honestly, if it helps me with my project and it's something for my resume, I would already be happy -- other people actually using my code would be incredible to me).
 

FactChecker

Science Advisor
Gold Member
2018 Award
5,048
1,773
I think you are reaching a stronger conclusion than I would. Most of the code that I have seen was developed specifically for the problem that the engineers were working on. I'm not sure how much they could use more generic opensource code. A lot of the general utilities are already available.
 
171
24
I think you are reaching a stronger conclusion than I would. Most of the code that I have seen was developed specifically for the problem that the engineers were working on. I'm not sure how much they could use more generic opensource code. A lot of the general utilities are already available.


I could make it specific to something I'm knowledgeable about (like something hydraulics related) instead of making it general to all of engineering. All the built in constants parameters and plot types would be specific to that. I'm essentially working from specific to general, so this may even happen naturally. (I'm not going to start by creating a program for all of engineering or physics and try to implement everything). I could then use it for research I'm doing at school (also hydraulics related).

Also, out of curiosity, what is the opensource code which is similar to this? (If I were to ask my mentor, he would probably have no idea what I'm talking about).
 

FactChecker

Science Advisor
Gold Member
2018 Award
5,048
1,773
By all means, give it a try. It's disappointing that the company you work in does not recognize your enthusiasm. Maybe they are not aware. Be sure to let them know of your interest.

Information about which MATLAB software which is used in studying hydraulic problems can probably be obtained in the engineering sections of this forum.
 
171
24
To be fair, they do have good reason not to.

1. I'm only 19.
2. I'm an reu student. Although I'm getting paid it's not really a job.
3. I only started learning Matlab a year ago. As far as they're concerned, all I know is what I learned in my intro to Matlab course (stuff like loops, branches, just touched on classes). Almost everything was self taught ( mainly through research at my school).
4. I was not assigned to write code per say but rather just to make some graphs to help others visualize the data.
5. I only briefly mentioned my knowledge of Matlab when introducing myself. I would say I learned more about coding at an abstract level these two weeks then I did the rest of my time learning it.
6. They want to make sure they have these plots created soon as possible.
7. Although they think my plots are decent, I'm always assigned to add more (add a caption, add a time series to an animation etc.) It can distract me a bit from working on the code, but I think it does force me to keep my code practical because I constantly have to use it while I'm writing it
 

FactChecker

Science Advisor
Gold Member
2018 Award
5,048
1,773
Keep up the good work. I think you will not be disappointed in the long run.
 

anorlunda

Mentor
Insights Author
Gold Member
7,301
4,071
It sounds like you have the urge to create. Good for you.

Thousands of open source programmers share that characteristic. You might consider joining them. You'll probably begin joining an existing project and working with others. The online chats with the others might offer you valuable career advice.

Posting to Github is a lot like writing a blog. You're never sure how much impact it has on others because of lack of feedback. Working on a project with others is IMO, more satisfying.
 
171
24
I think I'm going to save some new code which doesn't have all the stuff specific for my project, document a bit with comments (and maybe warnings and errors if I can get that working) upload it to discord and put the link here so anyone who wants can view or edit it. I think I should have that done my Monday hopefully.
 
171
24
You'll probably begin joining an existing project and working with others.
I don't quite understand how I would integrate what I wrote into an existing project. Or do you mean working on something else? I don't really want to do that, both because I want to use it for the research I'm doing and because my interest lies more in the physics and engineering as opposed to the code itself.
 

Want to reply to this thread?

"MATLAB Code For Analyzing Experimental Data" You must log in or register to reply here.

Related Threads for: MATLAB Code For Analyzing Experimental Data

Replies
3
Views
57K
Replies
3
Views
1K
Replies
2
Views
3K
  • Posted
Replies
1
Views
1K
  • Posted
Replies
2
Views
1K
  • Posted
Replies
2
Views
3K
Replies
3
Views
530

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top