freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

matlab基礎(chǔ)知識-資料下載頁

2025-09-25 17:00本頁面
  

【正文】 g more than one set of (x, y) value in the plot function. x = 0 : pi/100 : 2*pi。 y1 = sin (2 * x)。 y2 = 2 * cos (2 * x)。 plot (x, y1, x, y2)。 s in 2 2 c o s 2d xxdt ?( ) s in 2f x x?Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 80 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 81 Line Color, Line Style, Marker Style, and Legends Use attribute character string after the x and y vectors in the plot function. Three ponents: 1. Specify the color of line。 2. Specify the style of marker。 3. Specify the style of line. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 82 Color Marker Style Line Style y yellow . point solid m magenta o circle : dotted c cyan x xmark . dashdot r red + plus dashed g green * star b blue s square w white d diamond k black v triangle (down) ^ triangle (up) Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 83 triangle (left) triangle (right) p pentagram h hexagram Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 84 x = 0 : 1 : 10。 y = x .^ 2 – 10 .* x + 15。 plot (x, y, 39。r39。, x, y, 39。bo39。)。 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 85 legend (39。string139。, 39。string239。,..., pos) pos: an integer specifying where to place the legend. Value Meaning 0 Automatic ―best‖ placement (least conflict with data) 1 Upper righthand corner (default) 2 Upper lefthand corner 3 Lower lefthand corner 4 Lower righthand corner 1 To the right of the plot Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 86 legend off: Remove an existing legend. x = 0 : pi/100 : 2*pi。 y1 = sin (2*x)。 y2 = 2 * cos (2*x)。 plot (x, y1, 39。k39。, x, y2, 39。b39。)。 title (39。 Plot of f(x) = sin (2x) and its derivative39。)。 xlabel (39。x39。)。 ylabel (39。y39。)。 legend (39。f(x)39。, 39。d/dx f(x)39。) grid on。 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 87 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 88 Logarithm Scales 1. plot, both x and y on linear axes. 2. semilogx, x on logarithmic axes and y on linear axes. 3. semilogy, x on linear axes and y on logarithmic. 4. loglog, both x and y on logarithmic axes. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 89 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 90 Example Example —Temperature Conversion Design a MATLAB program that reads an input temperature in degrees Fahrenheit, converts it to an absolute temperature in Kelvin, and write out the result. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 91 Solution: 1. Prompt the user to enter an input temperature . 2. Read the input temperature. 3. Calculate the temperature in Kelvin from equation. 4. Write out the result, and stop. 5( i n K e l v i n ) ( i n F ) 3 2 . 0 2 7 3 . 1 59TT??? ? ?????inFChapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 92 Good Programming Practice Always include the appropriate units with any values that you read or write in a program. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 93 Example —Electrical Engineering: Maximum Power Transfer to a Load Figure show a voltage source V = 120V with an internal resistance RS of 50 Ω supplying a load of resistance RL. Find the value of load resistance RL that will result in the maximum possible power being supplied by the source to the load. How much power will be supplied in this case? Also, plot the power supplied to the load as a function of the load resistance RL. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 94 +_RSRL LoadChapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 95 Solution: 1. Create an array of possible values for the load resistance array will vary RL from 1Ωto 100 Ω in 1Ω steps. 2. Calculate the current for each value of RL. 3. Calculate the power supplied to the load for each value of RL. 4. Plot the power supplied to the load for each value of RL and determine the value of load resistance resulting in the maximum power. 2LLP I R?T O T s LVVIR R R?? ?Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 96 Example —Carbon 14 Dating is initial quantity of a radioactive substance at time t = 0. is the radioactive decay constant, for C14 is 0() tQ t Q e ???0Q?d e c a y01 l o geQtQ??Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 97 Solution: 1. Prompt the user to enter the percentage of carbon 14 remaining in the sample. 2. Read in the percentage. 3. Convert the percentage into the fraction . 4. Calculate the age of the sample in years. 5. Write out the result, and stop. 0Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 98 Debugging MATLAB Programs Three type of errors. 1. syntax error spelling errors, punctuation errors, can be detected by the MATLAB piler. 2. runtime error Inf/NaN. 3. logic error Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 99 typographical errors ?caught by piler ?can not detect by MATLAB Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 100 Deal with logic error and check assignment statements 1. Break long statement into several short statements. 2. Check placement of parentheses. 3. Make sure to initialize all variable properly. 4. Be sure to use correct units. Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi University 101 Good Programming Practice 1. Initialize all variables. 2. Use parentheses to make the functions of assignment statements clear.\ Symbolic debugger in Chapter 3 Chapter 2 MATLAB Basics 10/23/2022 Hangzhou Dianzi
點擊復制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1