Info

This question is closed. Reopen it to edit or answer.

Can anyone know how to do that, I also upload the image of the question

1 view (last 30 days)
Can anyone know how to do that, I also upload the image of the question
function rand('twister',800);
for count = 1:500
vector = 1 + floor(6*rand(1,4));
results(count)=sum(vector);
end
  2 Comments
Matt J
Matt J on 24 Nov 2013
Don't do that. Write the question in your words and show what you've done to solve it.

Answers (2)

Image Analyst
Image Analyst on 24 Nov 2013
rand() is a built-in function. You should not overwrite it, especially if you're going to call it inside your new function!!!

Walter Roberson
Walter Roberson on 24 Nov 2013
You cannot have a literal string or a numeric value in the "function" statement.
Remember to assign the output in the "function" statement.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!