I need this in MATLAB code. The leftmost digit of my student ID number is 1 so a
ID: 2083751 • Letter: I
Question
I need this in MATLAB code. The leftmost digit of my student ID number is 1 so a=1 in this.
PROBLEM STATEMENT Let a denote the leftmost numerical digit of your student ID number. Consider the signal zInl n(0.9 TOO)n. This signal rises from 0 at time 0 to a maximum value and then falls back towards zero as n oo. 1. Represent, but do not print out, this signal using a list of time values and a list of signal values from n 0 to n 1000. Call the list of time values n and the list of signal values x 2. Let x max denote the maximum value of this signal and let n max be the time value where this maximum occurs. Use MATLAB to determine and print out these two values, including the names of the variables 3. Let x double be the value of the signal at double the time n max. Determine and print out this value, including the name of the variable 4. Let n turnoff denote the turn-off time, defined as the maximum time value n where rn is greater than 1% of x-max. Determine and print out this value, including the name of the variable.Explanation / Answer
Solution :
%run this code and you will get all the answers
clear all;
clc;
a=1;
%1 represent n=time x_n=value
n=0:1000;
x = n.*((0.9+ (a/100) ).^n);
%2 get the max and location
[x_max n_max] = max(x)
%3 print value at x_double
x_double = x(2*n_max)
%turn_off time
y = [x_max*ones(1,n_max-1) x(n_max:1001)];
x_turnoff = 0.01*x_max;
all_less_index = find(y<x_turnoff);
n_turnoff = all_less_index(1)
plot(n,x);
%**************************************************************
x_max =
3.8981
n_max =
12
x_double =
2.6283
n_turnoff =
82
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.