I have two float variables:
x = 0.5;
y = 1.5;
I would like to floor them:
x = floor(x);
y = floor(y);
Can i do it in a single command? this raises an error:
[x y] = floor([x y]);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can write your own wrapper for floor:
This function shows the required behavior if you provide x and y as two separated arguments
This results in
If you want to use the concatenated array
[x y]as input (like in your example) you can use the following function:Then you would call
This results in