The output mentioned in the question as an example is not correct according to the question as the absolute error is found the minimum for work 'Survivor' (1 for Redemption and 4 for Island) twice and then 'Drag Race' (5 for Redemption). Also, there is a clash between how the input is expected in the question(example: input is said to be a 2XN cell in written but in the example code it is given as an NX2 cell). There are a lot of such ambiguities in the question. The required code is given below:
function out = hahaYes(File_name,Cell)
% reads the values in matrix A and the heading in text
[A text] = xlsread(File_name);
% to calculate size of the Cell that is given as input
[r_cell c_cell] = size(Cell);
% to calculate size of the matrix A
[r_excel c_excel] = size(A);
l = 1;
% logic to calculate the absolute error
for i = 1:r_cell
for j = 2:c_excel+1
if strcmp(Cell{i,1},text{1,j}) == 1
pos_excel(l) = j;
l = l+1;
for k = 1:r_excel
data(k,i) = abs(Cell{i,2} - A(k,j-1));
end
end
end
end
min1 = Inf;
min2 = Inf;
min3 = Inf;
pos = zeros(3,2);
% To find the position of first minimum
for i = 1:r_cell
for j = 1:c_cell
if data(i,j) < min1
min1 = data(i,j);
pos(1,1) = i;
pos(1,2) = j;
end
end
end
% To find the position of second minimum
for i = 1:r_cell
for j = 1:c_cell
if data(i,j) < min2 && data(i,j) > min1
min2 = data(i,j);
pos(2,1) = i;
pos(2,2) = j;
end
end
end
% To find the position of third minimum
for i = 1:r_cell
for j = 1:c_cell
if data(i,j) > min2 && data(i,j) < min3
min3 = data(i,j);
pos(3,1) = i;
pos(3,2) = j;
end
end
end
% returning the output
for i = 1:3
out{i,1} = text{pos(i,1)+1,1};
end
end
Function Name: hahaYes Inputs: 1. 2. (char) The filename of an Excel file containing word counts ...
Please write this in C. Write this code in Visual Studio and upload your Source.cpp file for checking (1) Write a program to prompt the user for an output file name and 2 input file names. The program should check for errors in opening the files, and print the name of any file which has an error, and exit if an error occurs opening any of the 3 For example, (user input shown in caps in first line) Enter first...
2. Let's now use Excel to simulate rolling two 6-sided dice and finding the minimum of both dice. • Create a new Excel sheet in your document. Click on cell Al, then click on the function icon f. and select Math&Trig, then select RANDBETWEEN. In the dialog box, enter 1 for bottom and enter 6 for top. • After getting the random number in the first cell, click and hold down the mouse button to drag the lower right corner...
Function Name: zoomZoom Inputs: 1. (double) An Nx5 array of scooters' speeds at various times 2. (double) The time at which you want to find the scooters' speeds Outputs: 1. (double) A 1x5 vector of scooters' speeds at the given time Background: Scooter go zoom zoom! Function Descripti on : You will be given an array with times in the first column, and speeds of different electric scooters in columns 2-5 that correspond to those times. Use spline interpolation or...
CSC110 Lab 6 (ALL CODING IN JAVA) Problem: A text file contains a paragraph. You are to read the contents of the file, store the UNIQUEwords and count the occurrences of each unique word. When the file is completely read, write the words and the number of occurrences to a text file. The output should be the words in ALPHABETICAL order along with the number of times they occur and the number of syllables. Then write the following statistics to...
Implement the histogram function to complete the desired program. You must use dynamically allocated arrays for this purpose. For your initial implementation, use ordered insertion to keep the words in order and ordered sequential search when looking for words. Note that the array utility functions from the lecture notes are available to you as art of the provided code. Although we are counting words in this program, the general pattern of counting occurrences of things is a common analysis step...
please disregard the excel question А B D Question 1 -- Stacy's Travel Agency 2 3 8 Instructions 4. You are an agent at a local travel agency. Your manager has asked you to track your sales of next winter's holiday packages. For each package, customers can schoose whether or not to include a flight in the package. For each sale, an initial down payment of 20% of the total package cost is required. 6 Customers can pay the remainder...
1. You are given a C file which contains a partially completed program. Follow the instructions contained in comments and complete the required functions. You will be rewriting four functions from HW03 (initializeStrings, printStrings, encryptStrings, decryptStrings) using only pointer operations instead of using array operations. In addition to this, you will be writing two new functions (printReversedString, isValidPassword). You should not be using any array operations in any of functions for this assignment. You may use only the strlen() function...
In C++ Please please help.. Assignment 5 - Payroll Version 1.0 In this assignment you must create and use a struct to hold the general employee information for one employee. Ideally, you should use an array of structs to hold the employee information for all employees. If you choose to declare a separate struct for each employee, I will not deduct any points. However, I strongly recommend that you use an array of structs. Be sure to read through Chapter...