Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MX12 ServoRingBuffer mbed-src
Fork of SpindleBot by
data_set/data_set.h@13:6a0a7a04fd91, 2015-08-13 (annotated)
- Committer:
- labmrd
- Date:
- Thu Aug 13 17:26:23 2015 +0000
- Revision:
- 13:6a0a7a04fd91
- Parent:
- 5:72e92c721cd5
As of Mark Brown's beginnings of reverting to Spindlebot 1.5
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| labmrd | 5:72e92c721cd5 | 1 | #ifndef DATA_SET_H |
| labmrd | 5:72e92c721cd5 | 2 | #define DATA_SET_H |
| labmrd | 5:72e92c721cd5 | 3 | |
| labmrd | 5:72e92c721cd5 | 4 | #include <vector> |
| labmrd | 5:72e92c721cd5 | 5 | #include <sstream> |
| labmrd | 5:72e92c721cd5 | 6 | |
| labmrd | 5:72e92c721cd5 | 7 | class data_set |
| labmrd | 5:72e92c721cd5 | 8 | { |
| labmrd | 5:72e92c721cd5 | 9 | public: |
| labmrd | 5:72e92c721cd5 | 10 | data_set(); |
| labmrd | 5:72e92c721cd5 | 11 | data_set(int size,std::string new_title="",std::string new_ylabel="y",std::string new_xlabel="x"); |
| labmrd | 5:72e92c721cd5 | 12 | void add_data(float value_y,float value_x=0.0); |
| labmrd | 5:72e92c721cd5 | 13 | float min(void); |
| labmrd | 5:72e92c721cd5 | 14 | float max(void); |
| labmrd | 5:72e92c721cd5 | 15 | float xmin(void); |
| labmrd | 5:72e92c721cd5 | 16 | float xmax(void); |
| labmrd | 5:72e92c721cd5 | 17 | float mean(void); |
| labmrd | 5:72e92c721cd5 | 18 | float stdev(void); |
| labmrd | 5:72e92c721cd5 | 19 | void least_squares(float &a0,float &a1); |
| labmrd | 5:72e92c721cd5 | 20 | data_set get_fit(void); |
| labmrd | 5:72e92c721cd5 | 21 | std::string get_string(void); |
| labmrd | 5:72e92c721cd5 | 22 | bool least_squares_3rd(float coeffs[4]); |
| labmrd | 5:72e92c721cd5 | 23 | bool Invert4x4Matrix(const float m[16], float invOut[16]); |
| labmrd | 5:72e92c721cd5 | 24 | |
| labmrd | 5:72e92c721cd5 | 25 | int data_size; |
| labmrd | 5:72e92c721cd5 | 26 | int current_position; |
| labmrd | 5:72e92c721cd5 | 27 | std::vector<float> data_x; |
| labmrd | 5:72e92c721cd5 | 28 | std::vector<float> data_y; |
| labmrd | 5:72e92c721cd5 | 29 | std::string title; |
| labmrd | 5:72e92c721cd5 | 30 | std::string xlabel; |
| labmrd | 5:72e92c721cd5 | 31 | std::string ylabel; |
| labmrd | 5:72e92c721cd5 | 32 | }; |
| labmrd | 5:72e92c721cd5 | 33 | |
| labmrd | 5:72e92c721cd5 | 34 | #endif // DATA_SET_H |
