Question: MATLAB - For some reason this is being rejected; possible type error? Formatting multiple strings firstValue, secondValue, and thirdValue are user provided values with varying
MATLAB - For some reason this is being rejected; possible type error?
Formatting multiple strings firstValue, secondValue, and thirdValue are user provided values with varying precision. Assign combined Stats with a string consisting of firstValue, secondValue, and thirdValue, each with three decimal places and separated by an underscore Ex: If firstValue is 3.14, secondValue is 2.71828, and thirdValue is 0.1100010000, then combinedStats is 3.140_2.718_0.110 Your Function Save C Reset MATLAB Documentation 1 function combinedStats CombineValues(firstValue, secondValue, thirdValue) 21 combinedStats sprintf("%.3f-%.3f_%.3f", firstva lue, secondValue, thirdValue); 3 end Code to call your function C Reset 1 CombineValues (3.14, 2.71828, 0.1100010000) Run Function Assessment: Incorrect Submit X Check if CombineValues(3.14,2.71828, 0.1100010000) returns 3.140 2.718 0.110' Function failed for inputs 3.14 2.71828 0.1100010000 Expected: 3.140_2.718_0.110 Your value: 3.140_2.718_0.110 Formatting multiple strings firstValue, secondValue, and thirdValue are user provided values with varying precision. Assign combined Stats with a string consisting of firstValue, secondValue, and thirdValue, each with three decimal places and separated by an underscore Ex: If firstValue is 3.14, secondValue is 2.71828, and thirdValue is 0.1100010000, then combinedStats is 3.140_2.718_0.110 Your Function Save C Reset MATLAB Documentation 1 function combinedStats CombineValues(firstValue, secondValue, thirdValue) 21 combinedStats sprintf("%.3f-%.3f_%.3f", firstva lue, secondValue, thirdValue); 3 end Code to call your function C Reset 1 CombineValues (3.14, 2.71828, 0.1100010000) Run Function Assessment: Incorrect Submit X Check if CombineValues(3.14,2.71828, 0.1100010000) returns 3.140 2.718 0.110' Function failed for inputs 3.14 2.71828 0.1100010000 Expected: 3.140_2.718_0.110 Your value: 3.140_2.718_0.110
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
