Question: I have the following function for which I want to find the extrema using matlab. 

![enter image description here](https://i.stack.imgur.com/UMKYe.png)

That function has to use the "normcdf" function in matlab in order to get the results but when I'm trying to create the symbolic function I get back some errors.

The input I give is the following:

```
syms z fz t sz
fv = 1000 * ((z * fz * normcd(t,fz,sz)) / (20 * 50 * normcd(t,50,20))) + 1000 * normcdf((20 * 50 * normcd(t,50,20) + z * fz * normcd(t,fz,sz)) / 2000, 50 * normcd(t,50,20), 20) - 10 * z

```

and the errors I get back are the following:

```
??? Error using ==> sym.le at 11
Function 'le' is not implemented for MuPAD symbolic objects.

Error in ==> normcdf at 57
sigma(sigma <= 0) = NaN;

```

Does anyone know how I can get around that? Thanks in advance.

I forgot to mention that I use matlab version R2009a.

Answer: 
<http://dev.elevationblog.com/2009/07/23/event-calendar-rails-plugin/>

After loading almost all the comments I found the answer to that question.

just override the color method in your event model.

```
def color
# color logic based on event type
# or maybe associated calendar?, ie
# self.calendar.color
   if self.type = correct_type 
      return "#3399BB" #any html acceptable color  
   end
end

```

answered by jeff

do your logic then return the color you want to used
I did things a little differently for more flexibility based on info I found on this site. 

**Output**

```
  <div class="btn-group event_color" data-toggle="buttons-radio">
    <button type="button" class="btn btn-success" value="#00a651">Active</button>
    <button type="button" class="btn btn-warning" value="#ecef0b">Pending</button>
    <button type="button" class="btn btn-danger" value="#ef0b0b">On Hold</button>
    <%=f.hidden_field :color %>
    <%=f.hidden_field :event_status %>
  </div>    

```

**JS**

```
   $(".event_color .btn").click(function() {
   // whenever a button is clicked, set the hidden helper
   $('#event_color').val($(this).val());
   }); 

   $(".event_color .btn").click(function() {
   // whenever a button is clicked, set the hidden helper
   $("#event_event_status").val($(this).text());
   }); 

```