The code that you attached is defined for two limit states only, so it still works. Thus I am going to assume that you define your combined four limit state functions like this that gives you the error (slightly edited for conciseness):

```
...
fullsystem.mString = 'min(limState1, limState2, limState3, limState4)';
...
```

I think, the problem is that the MATLAB function `min`

does not work like that. You can check the documentation (`help min`

), but here’s one possible solution based on how it works for your case:

If you have four vectors that you want to put as input into the function then you need to combine them first into a single matrix and then operate the `min`

on a particular dimension (either row-wise or column-wise).

So given four vectors `limState1, limState2, limState3, limState4`

, you can write:

```
...
fullsystem.mString = 'min([limState1, limState2, limState3, limState4], [], 2)';
...
```

in which all the limit states are combined into a four-column matrix and uses it as the first argument, then find the minimum along each row (2nd-dimension in MATLAB convention). The middle argument is set empty.

You can substitute each of `limState1`

, etc. above with the actual expression of your limit states.

Hopefully, this solves your problem.