Lt (Due on 2/9/2018 at 12:00 PM - Return to the instructor in class) 1. What is
ID: 2074051 • Letter: L
Question
Lt (Due on 2/9/2018 at 12:00 PM - Return to the instructor in class) 1. What is the purpose of the MATLAB Command Window? The Edit Window? The Figure Window? 2. List the different ways that you get help in MATLAB 3. What is a workspace? How can you determine what is stored in a MATLAB workspace? 4. How can you clear the contents of a workspace? 5. The distance traveled by a ball falling in the air is given by the equation x=Xo+Vot + at? Use MATLAB to calculate the position of the bll at time / 5 s, if xo 10 m, vo 15 m/s, and a =-9.81 m/sec? 6. Suppose that x = 3 and y = 4, Use MATLAB to evaluate the following expression: x2y (x -y)2 7. 8. What is the difference between an array, a matrix, and a vector? Answer the following questions for the array shown here. 1.13.2 3.4 0.6 C=10.6 1.1-0.6 3.1 1.3 0.6 5.5 0.0 a) What is the size of C? b) What is the value of C (2,3)? c) List the subscripts of all elements containing the value 0.6. 9. Determine the size of the following arrays. Check your answers by entering the arrays into MATLAB and using the whos command or the Workspace Browser. Note that the later arrays may depend on the definitions of arrays defined earlier in this exercise. a) u= [1020% 10+201; b) v [1; 20; 3]; c) w [1 0-9; 2-2 0; 1 2 3]; d) x=(u, v]; e) y (3,3)=-7; f) z [zeros (4,1) ones (4,1) zeros (1,4)']Explanation / Answer
Answer: 1) Command Window: The window where you can type commands and non-graphic output is displayed. A ‘>>’ prompt shows you the system is ready for input. The lower left hand corner of the main window displays ‘Ready’ or ‘Busy’ when the system is waiting or calculating.
The edit window: The window where you edit m-files — the files that hold scripts and functions that you’vedefined or are editing — and includes most standard word-processing options and keyboardshortcuts. It can be opened by typing edit in the Command Window. Typing edit myfile will open myfile.m for editing.
Figure window : MATLAB opens figures in separate windows, which includes the ability to fine-tune the appearance of the plot, zoom, etc. You can also use the Data Cursor to extract values and save them to the Workspace.
2) There are two equivalent ways (i.e., both ways access the same underlying information) that you can access the MATLAB help system. The first is simply to type at the command prompt in the MATLAB command window "help" followed by the name of the command or function for which you want help. Doing this will then present you with some text describing the MATLAB command or function you typed. Here is how you access the help information for the date command. » help date
In addition, you can get help information about a particular functional category, and its member commands and functions, by simply typing at the command prompt "help" followed by the name of the functional category. For example, typing "help timefun" will give you information about the "timefun" functional category:
» help timefun
Another important command for accessing the MATLAB help system is the "lookfor" command.
3) workspace displays the Workspace browser, a graphical user interface that allows you to view and manage the contents of the workspace in MATLAB. It provides a graphical representation of the whos display, and allows you to perform the equivalent of the clear , load , open , and save functions.
You can store design data in the base workspace, model workspaces, or the Design Data section of a data dictionary. To permanently store local design data with a model, use model workspaces. To share design data between models, use data dictionaries or the base workspace. Data dictionaries permanently store the data, and you can control the data scope to establish ownership, partition the data to ease readability and maintenance, and track changes. If you use the base workspace, to permanently store the data, you must save it in a MAT-file or script file.
4) by giving command clc; clear all; close all;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.