faq
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
faq [2012/04/01 20:04] – aan | faq [2013/01/07 18:31] (current) – aan | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Frequently Asked Questions ====== | ====== Frequently Asked Questions ====== | ||
+ | |||
+ | FAQs and their answers will be posted here. | ||
/* | /* | ||
- | ===== FAQs for Assignment | + | ===== FAQs for Assignment |
- | ===I have trouble solving Question 5. Could you give us more hints?=== | + | === When I press c or m on the keyboard, the Correct/ |
- | There are a few ways to write this program. I assume that you have no problem | ||
- | reading the input file into a matrix. One way to write the rest of the program is | ||
- | to use a loop to go through all the rows in the matrix. In each pass of the loop, you | ||
- | take the information in one row of the matrix (which contains a person' | ||
- | height in cm, weight in kg, BMI value and BMI category). | ||
- | === To answer | + | The reason why your " |
+ | MATLAB automatically scales | ||
+ | in your plot command. That is, the value limits of x and y axes depend on the minimum and maximum values in the x and y vectors in your plot command. Thus, an absolute position such as (0.4, 0.5) may not be the center of your figure window. | ||
- | No, you cannot change your function for the first question in order to answer the second | + | This problem can be solved |
- | question. Your program for the second question has to call the function that only | + | |
- | takes a scalar as the input argument. | + | |
- | + | ||
- | + | ||
- | ===== FAQs for Assignment 3 ===== | + | |
- | + | ||
- | === I am unable to save a MATLAB script file on my computer. When I tried to save it, it is saved at the drive at York. Can I submit the files as Notepad files? === | + | |
- | + | ||
- | A couple of ways to solve this problem: | + | |
- | + | ||
- | 1. In the Editor window of MATLAB, save the file to your local disk C by selecting "Save as" from the File menu, and then in the pop-up window clicking on small down-pointing arrow beside the "Save in: " slot and choosing "Local disk (C: on ....)" | + | |
- | + | ||
- | 2. Copy and paste each program into Nodepad and save each program as a .txt | + | |
- | file and then change the extension of the file name to from .txt to .m . Changing the file name can be done by right-clicking on the file name (in the folder that contains the file) and selecting " | + | |
- | submitting the files using the .txt extension is ok. That is, the file names | + | |
- | can be a3q1.txt, a3q2.txt .... | + | |
- | + | ||
- | + | ||
- | === I am having trouble figuring out how to find the maximum value for question 2, could you give some tips? === | + | |
- | + | ||
- | Look at Exercises 1 and 2 in the lecture notes on Feb 3rd. They both find the biggest | + | |
- | number, but from smaller scales of vectors. Look at the solution to Exercise | + | |
- | 2, and extend it to find the biggest number from a vector of 4 values, and | + | |
- | then 5 values. Hope you see the repetitions and use a loop to implement | + | |
- | it. | + | |
- | + | ||
- | === For Part c) of Question 4, how can I take the dates in which the temperature in Anchorage was higher than the on in New York? === | + | |
- | + | ||
- | You need to put the dates one by one into a vector during the loop. After the loop you just need to print out the vector. See the solution to Exercise 7 in Feb 10th lecture notes. In that solution, a vector " | + | |
- | + | ||
- | ===== FAQs for Assignment 2 ===== | + | |
- | + | ||
- | === For Question 6, when I entered the command to add the Science mark as the last column in the matrix, the matrix was displayed as follows: === | + | |
- | 1.0e+003 | + | |
- | Columns 1 through 5 | + | |
- | + | ||
- | 2.3450 | + | |
- | 1.2340 | + | |
- | 5.4320 | + | |
- | 3.4560 | + | |
- | 6.5430 | + | |
- | 7.6540 | + | |
- | 4.5670 | + | |
- | + | ||
- | Column 6 | + | |
- | + | ||
- | 0.0760 | + | |
- | 0.0890 | + | |
- | 0.0845 | + | |
- | 0.0720 | + | |
- | 0.0875 | + | |
- | 0.0725 | + | |
- | 0.0825 | + | |
- | + | ||
- | === This is strange. Did I do anything wrong? === | + | |
- | + | ||
- | No, nothing is wrong. The display is fine. The values are displayed in the scientific notation. " | + | |
- | multiplied by 10 to the power of 3. See slide 22 of January 27th slides. We | + | |
- | didn't get the chance to talk about it in class. But everything was fine in | + | |
- | your output display. | + | |
- | */ | + | |
- | + | ||
- | ===== FAQs for Assignment 5 ===== | + | |
- | + | ||
- | === when I press c or m on the keyboard, the Correct/ | + | |
- | random locations. How do I make it in a way that it always appears in the middle? === | + | |
- | + | ||
- | The reason your " | + | |
- | MATLAB automatically scales the axes based on the values in x and y vectors | + | |
- | in your plot command. Thus, an absolute position such as (0.4, 0.5) may not be the center | + | |
- | of your figure window. | + | |
- | + | ||
- | This problem can be solved by using the axis command to set the value limits | + | |
of x and y axes after you use the plot command to draw the small shapes. For example, | of x and y axes after you use the plot command to draw the small shapes. For example, | ||
- | if the x and y coordinates of all your points are both between 0 and 1, you can use [0 1 0 1] with your axis command. Please see the lecture notes on this command. | + | if the x and y coordinates of all your points are between 0 and 1, you can use [0 1 0 1] with your axis command. Please see the lecture notes for more details |
Line 102: | Line 28: | ||
One way to do it is to copy and paste the content of a file into a .txt file on your local computer and then either submit the .txt files or change the file name suffix from txt to m and submit the .m files. | One way to do it is to copy and paste the content of a file into a .txt file on your local computer and then either submit the .txt files or change the file name suffix from txt to m and submit the .m files. | ||
+ | */ | ||
faq.1333310671.txt.gz · Last modified: 2012/04/01 20:04 by aan