MatLAB | Mathematica | MathCAD | Maple Answers

Questions: 245

Answers by our Experts: 142

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a matlab program to implement the Perceptron algorithm.
(a) Starting with a = 0, apply our program to the training data from ω1 and ω2.
Note the number of iterations required for convergence.
(b) Apply our program to ω3 and ω2. Again, note the number of iterations required
for convergence.
(c) Explain the difference between the iterations required in the two cases.
Use K-means algorithm with K=3 to
classify the Iris dataset with all four features (4
dimensions). Plot a figure to visualize the
sample data and the classifica=ons due to Kmeans
and the ground-truth
K-Mean Algorithm
1. Initialize
• Select initial m cluster centers
2. Find associations
• For each xi, assign the cluster with nearest center
• Find A to minimize J(X; C, A) with fixed C
3. Find centers
• Compute each cluster center as the mean of data in
the cluster
• Find C to minimize J(X; C, A) with fixed A
4. Stopping criterion
• Stop if clusters stay the same. Otherwise go to step 2

prove that this algorithm is always convergent
Generate 1000 sample points in 3-d space, where
each x, y, and z is uniformly distributed between 0 and
1. Write code to perform K-means of these points with
K=2, where the initial cluster centers also follow
uniform distribution. Run your code 3 times and plot
three 3-D figures. Print and submit your figures along
with your observations. In particular, what K-means
tells you? What is the truth?
Create a function file called narcissisticNumbers.m.
Using for loop(s) or while loop(s), write a function narcissisticNumbers that returns all the narcissistic
numbers between 300 and 399 (there should be two).
a number n is called narcissistic if it satisfies the condition
n = dk
k + dk-1
k + ... + d2
k + d1
k.
For example the 3-digit decimal number 153 is a narcissistic number because 153 = 13 + 53 + 33
Hint: 1) use a nested loop for all possible combinations of digits, or 2) use mod and fix/floor
functions.
Create a function file called narcissisticNumbers.m.
Using for loop(s) or while loop(s), write a function narcissisticNumbers that returns all the narcissistic
numbers between 300 and 399 (there should be two).
a number n is called narcissistic if it satisfies the condition
n = dk
k + dk-1
k + ... + d2
k + d1
k.
For example the 3-digit decimal number 153 is a narcissistic number because 153 = 13 + 53 + 33
Hint: 1) use a nested loop for all possible combinations of digits, or 2) use mod and fix/floor
functions.
Create a function file called seqSum.m for this problem.
Write a function seqSum(a, N) that returns the sum of the sequence of a, a/2, a/3, …, a/N where a and N
are integers. The function should return the value of a + a/2 + a/3 + … + a/N. You are not allowed to use
“for” or “while” loop for this problem.
Hint: create array(s) and then perform the summation
For this problem, you will be typing in the command line window to complete this problem.
Write commands to obtain the inverse of the array of A = [2 5; 10 4] by converting [A I] to [I AI] where
I is a 2x2 identify matrix (I = [1 0; 0 1]) and AI is the inverse of A. You are not allowed to use inv().
So, your initial matrix should be [2 5 1 0; 10 4 0 1] which is the combined [A I]. Once you convert A in
the initial matrix to I using a series of mathematical operations, the 3rd and the 4th columns of the
resulting matrix is AI. Extract the AI as the solution. Your last command should be A*AI that displays the
2x2 identify matrix as the result.
Write a function seqSum(a, N) that returns the sum of the sequence of a, a/2, a/3, ..., a/N where a and N are integers. The function should return the value of a + a/2 + a/3 + ... + a/N. You are not allowed to use “for” or “while” loop for this problem.

Hint: create array(s) and then perform the summation.
Write a single-player 3D 4x4x4 tic-tac-toe game in matlab.You need to design and implement an AI to play with the user.
LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS