Problem: A refinery wants to predict the octane number of gasoline from NIR spectra (1100–2500 nm). Standard linear regression fails due to collinearity.
Solution using MATLAB PLS Toolbox:
Code snippet:
analysis_launch; % Interactive GUI used for initial exploration
% Export to script:
pls_model = pls(X_snv_sg, Y_octane, 4, 'crossval', 'venetian');
validation_result = predict(pls_model, X_valid);
figure; plot(Y_valid, validation_result.pred1, 'ro'); refline(1,0);
xlabel('Reference Octane'); ylabel('Predicted Octane');
As the world moves toward Industry 4.0, the MATLAB PLS Toolbox is evolving. Recent versions (9.0+) include:
While PLS and PCA form the heart, the PLS Toolbox is distinguished by its methodological breadth and depth. matlab pls toolbox
| Feature | MATLAB PLS Toolbox | MATLAB plsregress | Python (scikit-learn) |
| :--- | :--- | :--- | :--- |
| GUI | Yes (interactive) | No | No |
| Preprocessing | 40+ chemometric methods | None | Limited (via Pipelines) |
| Cross-validation | 10+ methods (auto-config) | Manual implementation | Via cross_val_predict |
| Contribution Plots | Yes (one-click) | No | Requires manual coding |
| Regulatory Support | Yes (21 CFR Part 11) | No | No |
| Cost | High (Commercial) | Included in base | Free |
Unlike command-line-only solutions, the PLS Toolbox features the Analysis Window—an interactive GUI that allows you to drag-and-drop datasets, change preprocessing on the fly, and visualize results instantly. You can build a complex PLS model without writing a single line of code, then generate the MATLAB script for reproducibility. Problem: A refinery wants to predict the octane
MATLAB’s native plsregress is fine for a quick, textbook PLS model. But real-world data is messy. Real-world data needs:
The PLS Toolbox delivers all of this from a clean, point-and-click interface (or scriptable API). Code snippet: analysis_launch; % Interactive GUI used for