K

@Kaliyahj123

finalexamproblemNo.2bykaliyahjohnson.m

Octave
1 year ago
clc clear F = @(x) 2*x.^2 - 5*x + 7; x = linspace(-2, 4, 100); y = F(x); % Evaluate F(x) over the range plot(x, y, 'b-', 'LineWidth', 1.5); xlabel('x'); ylabel('F(x)'); title('Plot of F(x) = 2x^2 - 5x + 7'); grid on;

FinalexamproblemNo.2bykaliyahjohnson.m

Octave
1 year ago
clc clear F = @(x) 2*x.^2 - 5*x + 7; x = linspace(-2, 4, 100); y = F(x); % Evaluate F(x) over the range plot(x, y, 'b-', 'LineWidth', 1.5); xlabel('x'); ylabel('F(x)'); title('Plot of F(x) = 2x^2 - 5x + 7'); grid on;

Finalexam_Kaliyahj_question1.m

Octave
1 year ago
clc clear T = 0:0.01:10; Vs = zeros(size(T)); VL = zeros(size(T)); for i = 1:length(T) t = T(i); Vs(i) = 3 * exp(-t/3) * sin(pi * t); if Vs(i) > 0

hw6_kaliyahjohnson_question3

Octave
1 year ago
clc clear t = [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4]; % Time (s) v = [100, 62, 38, 21, 13, 7, 4, 2, 3]; % Voltage (V) exp_fit = @(p, t) p(1) * exp(-p(2) * t); fit_error = @(p) sum((exp_fit(p, t) - v).^2);

hw6_kaliyahjohnson_question2

Octave
1 year ago
clc clear t = [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4]; v = [100, 62, 38, 21, 13, 7, 4, 2, 3]; exp_fit = @(p, t) p(1) * exp(-p(2) * t); fit_error = @(p) sum((exp_fit(p, t) - v).^2);

hw6_kaliyahjohnson_question1

Octave
1 year ago
clc clear x_a = [25, 30, 35, 40, 45]; y_a = [5, 260, 480, 745, 1100]; x_b = [2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10]; y_b = [1500, 1220, 1050, 915, 810, 745, 690, 620, 520, 480, 410, 390]; linear_fit = @(p, x) p(1) * x + p(2); exp_fit = @(p,

12thlabassignment_kaliyahjohnson.m

Octave
1 year ago
clc clear x = linspace(-1, 1, 100); y = linspace(-1, 1, 100); [X, Y] = meshgrid(x, y); Z = sin(X.^2 + Y.^2) .* exp(-5 * X.^2 - Y.^2); figure;

Kaliyah_12thlabassignment_question1.m

Octave
1 year ago
clc clear x = linspace(-1, 1, 100); % 100 points in [-1, 1] y = linspace(-1, 1, 100); [X, Y] = meshgrid(x, y); Z = sin(X.^2 + Y.^2) .* exp(-5 * X.^2 - Y.^2); figure;

hw4_kaliyahj_question5.m

Octave
2 years ago
clc clear % Define the initial conditions x = 0; y = 0; dx = 0.01; while y < 9.8 x = x + dx; y = 10 * (1 - exp(-x / 4)); end

hw4_kaliyahj_question4.m

Octave
2 years ago
clc clear x = [-3, 0, 0, 2, 5, 8]; y = [-5, -2, 0, 3, 4, 10]; z_and = x & y; disp('Part (b) - z = x & y:') disp(z_and) z_or = x | y; disp('Part (c) - z = x | y:')

kaliyahj_question3_hw4.m

Octave
2 years ago
if x < y && z < 10 w = x * y * z; end

question2_kaliyahj_hw4.m

Octave
2 years ago
clc clear x = [-3, 0, 0, 2, 5, 8] y = [-5, -2, 0, 3, 4, 10] % Part (b) z_and = x & y disp(z_and) % Part (c) z_or = x | y disp(z_or)

question1_kaliyahj_hw4.m

Octave
2 years ago
clc clear price_A = [19, 18, 22, 21, 25, 19, 17, 21, 27, 29] price_B = [22, 17, 20, 19, 24, 18, 16, 25, 28, 27] price_C = [17, 13, 22, 23, 19, 17, 20, 21, 24, 28] days_above_both = sum((price_A > price_B) & (price_A > price_C)); disp(days_above_both

10-30.m

Octave
2 years ago
clc clear k= 1 sum = 0 while sum <= 2000 sum = sum + 2^k k = k+1 end

0ctober28.m

Octave
2 years ago
clc clear x= 6 if x < -1 y = exp(x+1) elseif x >= -1 & x <= 5 y = 2+cos(pi*x) else

hw3_kaliyah_question5.m

Octave
2 years ago
clc clear f = @(x)x.^2 g = @(y)3*cos(y) h = @(z) 6*exp(z)

hw3_kaliyah_question1.m

Octave
2 years ago
clear x = -5 + 8i; y = 10 + 5i; product = x * y; magnitude_xy = abs(products_xy) angle_xy =angles(products_xy) disp([magnitude_xy]): num2str(magnitude_xy) disp(angle_xy(radians)): num2str(angle_xy)

hw3_kaliyahjohnson_question4.m

Octave
2 years ago
clc clear f = @(x) 20*x.^2 - 200*x +3 x= linespace(0,10,100) y= f(x) plot(x,y) xlabel('x') ylabel('f(x)') title(plot of 20x^2 - 200x +3)

homework.kaliyahjohnson_question2.m

Octave
2 years ago
clc clear x = -5:0.5:5 left = sinh(x) right = (exp(x)-exp (-x))/2 plot(x,left,x,right,'*')

assignment8_kaliyahj.m

Octave
2 years ago
f = @(x) x.^2; x = -10:0.1:10; y = f(x); plot(x, y); xlabel('x'; ylabel('f(x)'); title('Plot of f(x) = x^2');