matlab homework solutions

matlab homework solutions

MATLAB Homework Solutions

1. Introduction to MATLAB

With our “MATLAB Homework Solutions” guide, we assume the learner has no prior experience with MATLAB. To give a basic understanding of the working of MATLAB, the guide starts with the very basic features and functions of the software and slowly moves on to more advanced topics, such as data analysis, manipulation, and mathematical visualization. As a numeric analysis tool, MATLAB is designed to process large quantities of numerical data. In our guide, we begin to demonstrate just how easy it can be to plot data and find trends. We show the user how to input data, in this particular example from an external file, and then ask MATLAB to produce a plot. The functions and script we use in this example are more complex than before but are still relatively simple, hinting towards the full capability and complexity of MATLAB that will be shown later in the guide. By exploring different screenshots and toolbars that help the user to visualize their data, we aim to introduce common data problems such as filtering and smoothing data. This will prove really useful to our learner when they come to use MATLAB for their homework; they could import the data and visualize it using the skills they have learned so far. Second to the last in our guide is the section on 3D plots and function plotting. This demonstrates another layer of complexity of MATLAB while introducing the concept of a surface plot. As well as guiding the user through creating this type of plot in our example, we also show how they can use different functions and modify the plot, which will enable them to complete more complex 3D and surface plots.

2. Basic MATLAB Functions

One of the most basic and important functions in MATLAB is the display function, which is used to display the results of a calculation. Fprintf is a function used to print information to the screen, but it is used for more complex formatting. You can use fprintf to control the way that numbers and text are displayed. Fprintf is more versatile than disp in terms of the formatting of the output. Also, input is a more versatile function and can be used to get numerical input through the command line, among other sources. Input is used in nearly the same way as with display functions – the user inputs a prompt and the function waits for the user to input information. However, if a function will be taking in a high number of inputs or if the inputs are strictly numerical, then input should be used, as we can set the type of input- e.g. It should be a float: n=input(‘Enter number:’) as opposed to waiting for input and then assuming the input is correct. When using the program in coursework it is advisable to comment code. The percent symbol is used to comment, which means that the text afterwards on that line will not be treated as code and will not be run. This is especially useful in a section of code that might be confusing, in which case the comments might be used to explain its operation. However there are other uses of the comments – including the ability to run selective parts of a program and help in debugging by removing section of code yet keeping a record of previous versions. James O’Brien and Dragan Maric, Interactive teaching and learning: a case study using MATLAB, University of Limerick, Ireland – “Students tend to be more successful in learning complex materials and in being motivated to engage in collaboration when the teaching methods begin with simple concepts and move on to complex problems” this objective is followed within both engineering in the Open Window… and the Interactive Laboratory work.

3. Advanced MATLAB Functions

We will discuss the following advanced MATLAB functions in this section, although it is not limited to these: functions with no argument and no return value, array or matrix return function, functions with argument and no return value, functions with argument and return values, local and global variables. Unlike the usual M-file, those mentioned advanced functions have their own format. I will take one function for each category for explanation purpose. Let’s start with a very simple function with no argument and no return value. The function just displays ‘this is powered by myFunc1’ at the command window. In order to create a function like this, the format of the M-file should be exactly as below: the function name line, the body of the function, end. Remember, there is no input argument for this type of function so the space between the function name and the two brackets is left empty. When there is no return value for a function, by default, the value is null. Such type of function is normally used to display or output some messages. The user-defined functions are able to return to the command window more than one vector or matrix. To do so, the left hand side of the corresponding assignment statement at the point of call must be the name of the array or matrix which will be received. As an example to illustrate this type of function.

4. MATLAB Programming Techniques

In the chapter on basic MATLAB functions, I discussed various types of operations that could be carried out on matrices and vectors. However, the concept of looping was not touched. I also did not discuss how a user-defined function could be written and used. MATLAB provides various types of loops to handle looping requirements, meaning, it provides programmers with a lot of choices to solve looping requirements. There is a while loop, for loop, and do while loop. It is obvious that the for loop is the simplest, most useful, and mostly used looping in programming, and I think this goes the same for MATLAB. In this post, I will try to elaborate on how to create a for loop in MATLAB and also give a couple of examples on the commonly used types of for loops. First of all, let’s get an overview of what a for loop is. For a MATLAB user, looping over a sequence of numeric values is an inevitable task. When I do this kind of task, the reason is most of the time I have to analyze each and every element in the matrix (other than using existing functions or vectorizing the operations). One thing to be noted is, every language provides ways to control a loop – in case the developer is interested to skip a certain portion of codes or use a special purpose of exiting a loop. This is usually achieved by using a conditional statement. Variables in a for loop defined within the for loop expression are local to the code within the for loop and it will not affect the values in the primary code executing package.

5. Conclusion

In the conclusion section, I learned that MATLAB is a very powerful and efficient tool in order to solve numerical problems. I started working lengthwise by familiarizing with the MATLAB environment and performing basic operations. When the parameters and working details started to increase, I began to write functions in MATLAB. I have learned how to write simple, efficient and useful codes with its effective techniques, thus I am able to complete my final year project using MATLAB. From the previous sections, I understand that MATLAB is an interactive software, so we can write a command to solve a single problem, or to create a program functions and procedures in order to solve numerous problems. We can use the Command Window as our principal interactive area to enter the command for the MATLAB, but when the length of the program is big enough, it is more efficient to write and store the program in “.m” file and execute it. Moreover, I am encouraged to do more research on what I have learned for each of the MATLAB capabilities such as in data analysis, mathematical modeling, and simulation. Now, I am able to use another programming language, such as C language which I learned previously with greater ease because I have been able to adopt a good programming style that I employed in my work using MATLAB. In short, I am glad that I have selected MATLAB as my engineering problem solving tool which is very effective in solving problems and generating meaningful data for analysis. Lastly, I express my heartfelt thanks to my lecturers who taught me this great software. I hope that my humble and little research will contribute to the vast world of technology for the benefits of human race. Thank you.

Place Your Order
(275 Words)

Approximate Price: $15

Calculate the price of your order

275 Words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total Price:
$31
The price is based on these factors:
Academic Level
Number of Pages
Urgency
Principle features
  • Free cover page and Reference List
  • Plagiarism-free Work
  • 24/7 support
  • Affordable Prices
  • Unlimited Editing
Upon-Request options
  • List of used sources
  • Anytime delivery
  • Part-by-part delivery
  • Writer’s sample papers
  • Professional guidance
Paper formatting
  • Double spaced paging
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)
  • 275 words/page
  • Font 12 Arial/Times New Roman

•Unique Samples

We offer essay help by crafting highly customized papers for our customers. Our expert essay writers do not take content from their previous work and always strive to guarantee 100% original texts. Furthermore, they carry out extensive investigations and research on the topic. We never craft two identical papers as all our work is unique.

•All Types of Paper

Our capable essay writers can help you rewrite, update, proofread, and write any academic paper. Whether you need help writing a speech, research paper, thesis paper, personal statement, case study, or term paper, Homework-aider.com essay writing service is ready to help you.

•Strict Deadlines

You can order custom essay writing with the confidence that we will work round the clock to deliver your paper as soon as possible. If you have an urgent order, our custom essay writing company finishes them within a few hours (1 page) to ease your anxiety. Do not be anxious about short deadlines; remember to indicate your deadline when placing your order for a custom essay.

•Free Revisions and Preview

To establish that your online custom essay writer possesses the skill and style you require, ask them to give you a short preview of their work. When the writing expert begins writing your essay, you can use our chat feature to ask for an update or give an opinion on specific text sections.

A Remarkable Student Essay Writing Service

Our essay writing service is designed for students at all academic levels. Whether high school, undergraduate or graduate, or studying for your doctoral qualification or master’s degree, we make it a reality.