User Tools

Site Tools


faq

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
faq [2012/02/23 18:05] aanfaq [2012/04/01 20:21] (current) aan
Line 1: Line 1:
 ====== Frequently Asked Questions ====== ====== Frequently Asked Questions ======
  
-/* 
-===== FAQs for Assignment 4 ===== 
  
-===I have trouble solving Question 5. Could you give us more hints?===+===== FAQs for Assignment =====
  
-There are a few ways to write this program. assume that you have no problem  +=== When press c or m on the keyboard, the Correct/Incorrect/Invalid keeps appearing at random locationsHow do I make it in a way that it always appears in the middle? ===
-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 matrixIn each pass of the loop, you  +
-take the information in one row of the matrix (which contains person's height in inches and weight in pounds), call the IPtoCK function to convert these two numbers into cm and kg, calculate the person's BMI based on the converted cm and kg, and then determine this person's BMI category and output a line in the output file (which shows this person'+
-height in cm, weight in kg, BMI value and BMI category).+
  
-=== To answer the second question, can we change our answer to the first question so that it can take a vector as the input? === 
  
-No, you cannot change your function for the first question in order to answer the second  +The reason why your "Correct!", "Incorrect!" or 'Invalid!" is shown at random places is that 
-questionYour program for the second question has to call the function that only  +MATLAB automatically scales the axes based on the values in the x and y vectors 
-takes a scalar as the input argumentThis can be easily done by using a loop.+in your plot commandThat 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 commandThus, 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,
 +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 on this command.
  
-===== 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 "Rename". If you are not able to change the file name, 
-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 "identified_Participants" is created with the loop. That is, whenever a condition in the if statement is satisfied, an element of this vector is added. The trick is in how keep track of the number of elements in this vector. In the solution to Exercise 7, variable number_of_OK is used for such a purpose.  
- 
-===== 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    0.0720    0.0800    0.0900    0.0820 
-    1.2340    0.0960    0.0820    0.0860    0.0880 
-    5.4320    0.0830    0.0860    0.0790    0.0780 
-    3.4560    0.0680    0.0760    0.0800    0.0900 
-    6.5430    0.0900    0.0850    0.0950    0.0670 
-    7.6540    0.0770    0.0680    0.0700    0.0690 
-    4.5670    0.0820    0.0830    0.0660    0.0790 
- 
-  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. "1.0e+003 *" means all the values (in the matrix displayed below) will be 
-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 3 ===== ===== FAQs for Assignment 3 =====
  
-=== In Question 5 b), we are asked to display the total marks using only one digit after +=== In Question 5 b), we are asked to display the total marks using only one digit after the decimal point. The "format bank" command displays two digits after the decimal point. Which command should we use for this question? ===
-the decimal point. The "format bank" command display two digits after the decimal points. +
-Which command should we use for this question? ===+
  
 The fprintf command. To display the marks for all the students, use a loop statement.   The fprintf command. To display the marks for all the students, use a loop statement.  
  
-/* +=== When submitting files from home, my computer does not allow me to access any files that are located in my WebFAS folder that they are saved to in Matlab. How can I submit the files? ===
-=== Do I need to put the output of the programs in the a1.txt file? === +
- +
-No, you only need to put the programs in the a1.txt file. There is no need to put the  +
-output of your programs in the file. */+
  
 +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.1330020337.txt.gz · Last modified: 2012/02/23 18:05 by aan

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki