MATLAB question:
TASK 4:
Programming code in MATLAB;
clc;
clear all;
close all;
function [t, v] = VPiecewise(start_t, end_t)
////////////// Creates two vectors v and t
//////////// Creating vector t at increments of 0.01
t = start_t:0.01:end_t;
///////////// Initializing vector v
v = [];
/////////// Using loop to find v values
for i=1:length(t)
///////// Finding profile conditions
if t(i)>=0 && t(i)<=10
//////////// Updaitng vector
v = [v ((11*t(i)*t(i)) - (5*t(i)))];
elseif t(i)>10 && t(i)<=20
///////////// Updaitng vector
v = [v (1100 - (5*t(i)))];
elseif t(i)>20 && t(i)<=30
////////////////// Updaitng vector
v = [v ((50*t(i)) + ( 2 * ( (t(i)-20) ^ (2.5) )))];
elseif t(i)>30
/////////////// Updaitng vector
v = [v ((1520) * ( exp((-0.1)*(t(i)-30)) ))];
else
v = [v 0];
end % If end
end % For loop end
end % Function end
Script:
//////////// Plotting travel of a real world objects in a jagged
manner
[t, v] = VPiecewise(-5, 80);
///////////// Plotting graph
plot(t, v);
title("Travel of a real world objects in a jagged manner");
xlabel("t");
ylabel("v");
MATLAB O/P:
TASK 5):
MATLAB CODE:
clc;
clear all;
close all;
%%%%%%%%%% the threshold value
Trshold = input('Please enter the error threshold:')
xvl = linspace(-2*pi,2*pi);
cos_trm = ones(size(xvl));
cos_appx = cos_trm;
nvl = 2;
xsqrd = xvl.^2*nvl;
%%%%%%%% Calculation of the approximation
while abs(cos_trm(end)) > Trshold
cos_trm = - cos_trm.*xsqrd./factorial(nvl);
cos_appx = cos_appx + cos_trm;
nvl = nvl + 2;
end
%%%%%%%%%% Calculate truncate error
trun_err = abs(cos_appx - cos(xvl));
fprintf('N value: %d \n',nvl);
fprintf('Mean truncation error: %0.6f \n',mean(trun_err));
fprintf('The error is: %0.6f \n', trun_err);
%%%%%%%%%%%% Perform the plot
plot(xvl,trun_err)
MATLAB O/P:
Task 4 Many real world objects travel in a jagged manner that is best represented by piecewise fu...
Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....
i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...
The last 3 cases are tests .cpp files to test the code. The language of this code must be C++ because that is the only I am familiar with. Soreland, a software company, is planning on releasing its first C++ compiler with the hopes of putting MiniSoft's Visual C++ out of business (that reminds me of another story). Consequently, Soreland has contracted with the Fruugle Corporation to design and build part of their compiler. Of course, since Fruugle gets all...
You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...
Notes for lab dc02-Resistors and the Color Code will skip are Part 2 e, g: Part 4; Exercises 2, 4,5,6 and 3. It is important to answer the exercises correctly in each labl you should include the appropriate prefix for the unit in the Numerical Value We will not be Volt using the Volt-Ohm meter (VOM) for this lab, so skip the parts that ask for VOM measurements. The parts we You do need to complete Exercises1 Note that in...
10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...