From: Lauren Philips on
Hello,


If the function is for instance:

function x = y (p)
x = p * 0.5;
end

How can I make this function automatically give round answers for x? (floor)
From: Cokelid on
On Feb 23, 11:41 am, "Lauren Philips" <lau...(a)trash2009.com> wrote:

> How can I make this function automatically give round answers for x? (floor)

Not wanting to *just* give you the answer. But try "help round" and
look under "See Also". There's lots to learn in the help.
From: Matt Fig on
"Lauren Philips" <lauren(a)trash2009.com> wrote in message
> How can I make this function automatically give round answers for x? (floor)

You want to know how to ROUND numbers in MATLAB? You also want to know if MATLAB has a FLOOR function? Did you bother to look?

docsearch('floor')
docsearch('round')
From: Jan Simon on
Dear Lauren!

> If the function is for instance:
>
> function x = y (p)
> x = p * 0.5;
> end
>
> How can I make this function automatically give round answers for x? (floor)

You suggest the FLOOR command -- I suggest the FLOOR command.

Kind regards, Jan