I have a function with a number of arguments, but some of them are optional.

1.) If when the function is called, some are left empty, how do I code it so that it defaults to a specific value?

2.) What if of 5 arguments, 3 are optional, how can the code recognize which one to set to default? For example:

```
function [u, v] = somefxn(required, required2, optional, optional2, optional3)

```

and say when I call this function, only `optional2` is filled.

**Update:** Is there something I can use that says

```
if optional2 is empty
    return default_value
end

```