{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ML10 - Matlab 10 Function Fun Tian Gu ID 853324472...

This preview shows pages 1–3. Sign up to view the full content.

Matlab 10 Function Fun Tian Gu ID: 853324472 Introduction In this lab, we solved the question of 4 queens at first. We also have seen how the functions were made, and we used MATLAB to write new function “multiply” ourselves. The most important part is writing “dice” function. And after that we tried to write a dice game called Pig. We finished some parts of this program. In the hands-on part, we have already finished the RC-circuits in the last lab, this time we tried to measure the amplitude at different frequencies and made a conclusion of them. 4 Queens-ByHand A Simple Function We first try the function doubleIt by running this m-file. >> doubleIt(8) ans = 16 It worked well. So now we can try to make a function just like that. We want to multiply two numbers, we can input them like (x, y), so we get: function [mutiply] = multIt(x,y); [multiply] = x.*y end Output: >> multIt(2,3) multiply =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Dice - Write your own function
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern