Pls Toolbox — Matlab

% After building a model vip_scores = vip(model); % Find indices of critical variables (VIP > 1) critical_vars = find(vip_scores > 1); % Plot spectra highlighting critical regions plotw(X_obj, 'color', 'k'); hold on; plotw(X_obj(:, critical_vars), 'color', 'r', 'linewidth', 2);