% Exercise 4 -- Logistic Regression clear all; close all; clc x = load('E:\workstation\data\ex4x.dat'); y = load('E:\workstation\data\ex4y.dat'); [m, n] = size(x); % Add intercept term to x x = [ones(m, 1), x]; % Plot the training data % Use differen…