{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
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 =
Image of page 1

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

View Full Document Right Arrow Icon
6 Dice - Write your own function
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern