![]() ![]() Try to condense the print-out as best as possible Note: For all labs and assignments copy and paste into Word file your program (script file), the relevant command window and plots if applicable. Write a Matlab program that will allow the user to enter theĮNGR 1204 Programming Languages in Engineering MATLAB Lab 2 %and the next one is position 2 and so on.Ģ. %note the highest degree coefficient is stored in position 1 J=degree %this is used for correct message display belowįprintf('Please enter the coefficient of power %d ',j) %this vector should be global so that other functions can useĭegree=input('Please enter the degree of the polynomial: ') %store the coefficients of the polynomial that have been Results are displayed with 2 decimal place accuracy. O Function polyRoots() will accept the coefficients and returns Point, and returns the value of the polynomial at that point. O Function polyEval() will accept a parameter, the evaluation O Function polynomial() will ask for the degree and theĬoefficients of the polynomial and would return the Calculations will be done by functions. Terminate only when Exit has been selected Selecting choice 2 and 3 before entering the degree andĬoefficients will result in an error message. Evaluate the polynomial at a user defined point Enter the degree and coefficients of the polynomial (using menu function) and provide her/him with the following SelectionsĪnd data entry will be done by presenting the user with a menu Write a Matlab program that will allow the user to enter theĬoefficients of a polynomial and make some calculations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |