Best way to visualise data outputted from a C program

In summary, The conversation discusses using C code to model the motion of two masses attached to a wall and each other by springs. The output file includes time, positions, and velocities for each block. The individual is looking for a way to visualize the data, and mentions possibly using Matlab or Mathematica to create a simulation. They also mention wanting a moving plot or GIF file of the Lissajous curves, but are unsure of what software is needed. It is suggested to use MATLAB to draw the blocks and springs and potentially save it as an AVI if fully licensed.
  • #1
conorordan
13
0

Homework Statement



I've written some C code that models the motion of two masses attached to a wall (and each other) by springs like this.

The output file is 5 columns; the time, and the positions and velocities of each block at that time.

I'm not sure how to visualise my data, ideally I want to make a simulation that shows two blocks moving as described by the data, I'm open to doing more coding and I have Matlab and Mathematica.

Homework Equations




The Attempt at a Solution



So far I've just been using Matlab to graph the motion but it isn't terribly interesting, I want something that moves. A moving plot (like a GIF file) of the Lissajous curves being plotted would be good but I'm not sure what software I need for this.

Thanks
 
Physics news on Phys.org
  • #2
You can use MATLAB to draw the blocks and springs, if that's what you're after.
Draw the blocks in the correct locations, than add each spring.
If you have fully licensed matlab, you can even save it as an AVI.
 

1. What are the different types of visualizations that can be used for C program data output?

The most commonly used types of visualizations for C program data output are bar graphs, line graphs, scatter plots, histograms, and pie charts. Each type has its own strengths and is suitable for different types of data.

2. How can I choose the best visualization for my C program data?

The type of visualization that is best for your C program data depends on the type of data you have and the story you want to tell with it. For example, if you want to show trends over time, a line graph would be a good choice. If you want to compare different categories, a bar graph or pie chart would be more suitable.

3. What are some tips for creating effective visualizations for C program data?

Some tips for creating effective visualizations for C program data include choosing the right type of visualization for your data, keeping the design simple and uncluttered, using color strategically, and labeling your axes and data points clearly.

4. How can I make my visualizations more interactive?

There are many tools and libraries available that allow for interactive visualizations of C program data. Some examples include D3.js, Plotly, and Tableau. These tools allow users to hover over data points, zoom in and out, and filter data to get a more detailed view.

5. Are there any common mistakes to avoid when visualizing C program data?

Some common mistakes to avoid when visualizing C program data include using the wrong type of visualization for your data, including unnecessary or misleading elements, and not properly labeling or scaling your axes. It is also important to ensure that your data is accurate and properly formatted before creating visualizations.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Advanced Physics Homework Help
Replies
12
Views
2K
  • Programming and Computer Science
Replies
25
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
2K
  • Programming and Computer Science
Replies
8
Views
2K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
19
Views
1K
Back
Top