Question 2 (25 points): Build a function f(t) that outputs according to the following conditions: f(t) = ln(t + 1) = {ince 0; t≤0 ;0 % Initialize f to 0 for all t f=zeros(size(t)); for i=1:length(t) f(i) = piecefcn(t(i)); end % Plot function here % Piecewise function here function [f]=piecefcn(t) % Conditional statement here end

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter20: Queuing Theory
Section20.6: The M/m/s/gd/∞/∞ Queuing System
Problem 1P
icon
Related questions
Question

do the following code on matlab with the given and specified format

Question 2 (25 points):
Build a function f(t) that outputs according to the following conditions:
f(t) = ln(t + 1)
= {ince
0; t≤0
;0<t<3.4725
Зе-0.2t
; Otherwise
Update the following code that has a template for the function and call it in the main to plot
the f(t).
% Main code
clc;
clear;
% Define t from -1 to 5 with a step size of 0.01
<Your Code here >
% Initialize f to 0 for all t
f=zeros(size(t));
for i=1:length(t)
f(i) = piecefcn(t(i));
end
% Plot function here
<Your Code here >
% Piecewise function here
function [f]=piecefcn(t)
% Conditional statement here
<Your Code here >
end
Transcribed Image Text:Question 2 (25 points): Build a function f(t) that outputs according to the following conditions: f(t) = ln(t + 1) = {ince 0; t≤0 ;0<t<3.4725 Зе-0.2t ; Otherwise Update the following code that has a template for the function and call it in the main to plot the f(t). % Main code clc; clear; % Define t from -1 to 5 with a step size of 0.01 <Your Code here > % Initialize f to 0 for all t f=zeros(size(t)); for i=1:length(t) f(i) = piecefcn(t(i)); end % Plot function here <Your Code here > % Piecewise function here function [f]=piecefcn(t) % Conditional statement here <Your Code here > end
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole