From mathematical fundamentals to reproducible experiments and engineering-grade algorithm validation.
Learn the language. Understand the mathematics. Validate the algorithm. Make the result reproducible.
This repository is a structured learning and practice space for MATLAB programming, scientific computing, data analysis, signal processing, control-system exploration, and embedded-algorithm verification.
It combines progressive learning notes, a staged study plan, a question-driven knowledge base, reusable examples, and engineering-oriented validation exercises. The aim is not merely to collect syntax, but to build a workflow that moves from understanding a concept to implementing it, testing it, and explaining its limitations.
Learning principle: Every important concept should lead to an experiment; every algorithm should have explicit assumptions, boundary conditions, and a way to verify its results.
| If you want to… | Start with | What you will find |
|---|---|---|
| Plan a complete learning journey | Study Plan | Stages, weekly practice, checkpoints, and projects |
| Learn MATLAB fundamentals | MATLAB Tutorial | Environment, syntax, arrays, matrices, and plotting |
| Practice through focused questions | MATLAB Basics — 100 Questions | Topic-based questions, explanations, and examples |
| Run and inspect practical code | Examples & Tests | Filtering, interpolation, Kalman filtering, FFT, quantization, and MATLAB/C comparisons |
| Look up commonly used functions | Function Reference | A practical function index |
| Explore recommended reading | Books | Books and further learning resources |
| Study native-code integration and debugging | GDB / MEX Notes | Related notes for debugging and native-code workflows |
The repository includes a small synthetic sensor dataset and a runnable analysis workflow, so you can practice a real file-to-plot pipeline without downloading external data.
| Resource | Purpose |
|---|---|
| Sensor sample CSV | 51 time-stamped signal samples for import and analysis exercises |
| CSV analysis demo | Reads the dataset, validates columns, smooths the signal, and marks statistical outlier candidates |
| Sensor analysis workflow diagram | Visual overview of the analysis stages |
| Sensor CSV example result | Illustrative chart of raw samples, smoothing, and an injected spike |
| Examples guide | Run instructions for MATLAB algorithms, tests, and MATLAB/C comparisons |
Run from the repository root in MATLAB:
run('Src/Examples/sensor_csv_demo.m')The included CSV is synthetic teaching data, not a real vehicle or hardware measurement. Outlier flags are candidates for review, not automatic fault diagnoses.
The repository is organized around a progression from fundamentals to applied engineering. Follow the full route, or jump into an individual topic when you need a targeted reference.
Visual guide: fundamentals → numerical computing → modeling → validation → engineering delivery.
flowchart TD
A["01 · Environment & Help"] --> B["02 · Language Fundamentals"]
B --> C["03 · Arrays & Matrix Computing"]
C --> D["04 · Functions & Data Processing"]
D --> E["05 · Visualization & Reporting"]
E --> F["06 · Numerical Methods"]
F --> G["07 · Signal Processing"]
F --> H["08 · Control Systems"]
G --> I["09 · Algorithm Modeling"]
H --> I
I --> J["10 · Simulink & System Simulation"]
J --> K["11 · MATLAB / C Cross-Validation"]
K --> L["12 · Reproducible Engineering Practice"]
| Fundamentals | Modeling & Analysis | Engineering Practice |
|---|---|---|
| Syntax, arrays, matrices | Numerical computation | Testable examples |
| Functions, scripts, data types | Filtering and FFT | Boundary-condition checks |
| Plotting and visualization | Interpolation and Kalman filters | MATLAB/C comparison |
| Tables, files, and data handling | Control-system exploration | Reproducible results |
The examples directory is the recommended starting point for hands-on practice.
| Topic | Practice focus |
|---|---|
| Arrays and statistics | Data construction, indexing, and summary operations |
| Low-pass filtering | Signal smoothing and response inspection |
| Linear interpolation | Interpolation behavior and input constraints |
| Kalman filtering | One-dimensional and position–velocity estimation |
| Sensor data and FFT | Outlier inspection and frequency-domain analysis |
| Fixed-point quantization | Quantization error and numerical representation |
| MATLAB / C comparison | Reference behavior, output comparison, and regression checks |
flowchart LR
A["Define the problem"] --> B["Document assumptions"]
B --> C["Build MATLAB reference"]
C --> D["Create test vectors"]
D --> E["Check normal & boundary cases"]
E --> F["Compare outputs"]
F --> G{"Within tolerance?"}
G -- Yes --> H["Record results"]
G -- No --> I["Investigate the difference"]
I --> C
H --> J["Regression test"]
For embedded or performance-sensitive algorithms, MATLAB can serve as a readable reference model before comparing a C implementation. Define numeric precision, units, initial conditions, saturation behavior, and tolerances explicitly; matching plots alone is not sufficient evidence of equivalence.
- Understand — Read the concept and identify the mathematical or programming principle.
- Implement — Write a small example that can be run independently.
- Visualize — Plot intermediate and final results to make behavior observable.
- Challenge — Test empty inputs, boundary values, unexpected dimensions, and noisy data where applicable.
- Compare — Validate against a known result, a reference implementation, or a documented expectation.
- Record — Keep the assumptions, execution steps, expected output, and conclusions with the code.
- Install MATLAB, or use an available MATLAB environment compatible with the examples.
- Clone or download this repository.
- Open the repository in MATLAB and navigate to the relevant example directory.
- Read the example's instructions before running it; check any toolbox or version requirements.
- Run the script or function and compare the result with the documented expectation.
git clone https://github.com/ilikui/Matlab.git
cd MatlabStart with the examples guide for the most direct route to executable practice.
Compatibility note: Some legacy notes may target MATLAB R2018b or depend on specific toolboxes. The installed MATLAB release and its official documentation take precedence. Check each example's requirements before execution.
Matlab/
├── README.md # Project overview and navigation
├── StudyPlan.md # Structured learning roadmap
├── Doc/ # Tutorials and conceptual notes
├── Questions/ # Question-driven practice
├── Src/
│ ├── Examples/ # Runnable examples and validation exercises
│ ├── Function.md # Function reference
│ └── Program/ # Native-code and debugging notes
├── Books/ # Recommended reading
└── Imge/ # Learning and documentation images
The tree above highlights the main entry points; consult the repository directories for the complete and current file list.
Learning material is most useful when it is clear, testable, and maintainable. Improvements are welcome in the form of corrected explanations, runnable examples, better visualizations, additional exercises, and reproducible validation cases.
When adding an example, aim to include:
- Purpose: the problem the example demonstrates.
- Requirements: MATLAB release and toolbox dependencies, if any.
- Inputs and outputs: expected shapes, units, and data types.
- Execution: clear steps to run the example.
- Validation: expected behavior, tolerances, and edge cases.
- Limitations: assumptions and known constraints.
See LICENSE for the license terms applicable to this repository.
Understand the math. Write the model. Verify the result.
An evolving, practical reference for MATLAB learning and engineering exploration.
The repository now includes focused guides that can be read independently or followed in order.
| Guide | What it covers |
|---|---|
| Environment & Workflow | Paths, diagnostics, reproducible project setup |
| Language Fundamentals | Types, operators, indexing, control flow |
| Arrays & Matrices | Dimensions, matrix algebra, data containers |
| Functions & Testing | Contracts, validation, regression tests |
| Data & Visualization | Import, cleaning, statistics, plots, export |
| Numerical Methods | Solvers, interpolation, error metrics |
| Signal, Control & Embedded | FFT, filters, Kalman models, MATLAB/C handoff |
| Engineering Project Portfolio | Progressive practical projects |
| Practice Labs | Ten hands-on labs with acceptance criteria |
| Function Index | Searchable reference to common functions |
To make the repository easier to use as a complete curriculum, two practical indexes are available:
| Resource | Purpose |
|---|---|
| Advanced MATLAB — 100 Questions | Deepen understanding of array semantics, debugging, data quality, numerical methods, signal processing, testing, and algorithm delivery |
| Engineering Project Roadmap | Turn concepts into portfolio projects with clear deliverables and acceptance criteria |
flowchart LR
A[Read a concept] --> B[Run a minimal example]
B --> C[Change inputs and test boundaries]
C --> D[Measure error and performance]
D --> E[Document assumptions and results]
E --> F[Package as a reproducible project]
- Learning notes: explain the concept, common mistakes, and version-specific behavior.
- Runnable code: avoid hidden workspace dependencies; include sample inputs or a deterministic data generator.
- Tests: cover nominal, boundary, invalid-input, and numerical-tolerance cases.
- Evidence: provide expected output, plots, error metrics, or a reference comparison.
- Navigation: link the new material from the relevant tutorial, example index, or question bank.
These resources complement the existing study plan, practice labs, and executable examples.
For the next step beyond the core tutorial, use the focused advanced question bank and the project-first practice guide:
- MATLAB Advanced — 100 Questions: language semantics, debugging, data workflows, numerical methods, signal/control, and engineering delivery.
- Project Portfolio & Acceptance Criteria: progressively build data-cleaning, interpolation, FFT, filtering, Kalman, control, and MATLAB/C validation projects.
- Standalone FFT Demo: a minimal frequency-domain example.
- Standalone Kalman Demo: a minimal state-estimation example.
- Smoke Tests: small checks for interpolation, FFT peak detection, and Kalman recursion.
flowchart LR
A[Read concept] --> B[Run example]
B --> C[Change input and parameters]
C --> D[Run tests]
D --> E[Document assumptions and error]
E --> F[Extend into a project]
The standalone demonstrations are educational starting points. Their presence does not imply they have been executed on every MATLAB release or validated for production use; run the tests in your own environment and adapt assumptions to the target application.
The repository now includes a complete, self-contained sensor time-series exercise: demo script, reusable analysis function, and function-based tests. It demonstrates input validation, robust outlier candidates, moving-average smoothing, descriptive statistics, and test-driven verification without requiring a toolbox or downloaded dataset.
