Mohamed H Hassan The error likely occurs because the size of beta_range does not match the length of the steady_states array. The steady_states array is initialized with a length of 100 in the code, but you've changed the length of beta_range to 10. To resolve the error, you should ensure that the length of beta_range matches the length of steady_states.
You can do this by either changing the length of beta_range back to 100 or by adjusting the code accordingly. If you want to keep beta_range with a length of 10, you should also adjust the initialization of steady_states to match that length. Here's how you can do it:
beta_range = linspace(0, 1, 10); % Range for beta
% Initialize arrays to store steady-state solutions
steady_states = zeros(length(beta_range), 4);
Make sure you update the length of beta_range to 10 wherever it's used in the subsequent code, to ensure consistency.