Community Profile

# Animesh Patel

123 total contributions since 2017

View details...

Contributions in
View by

Solved

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

3 years ago

Solved

Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

3 years ago

Solved

Remove the positive integers.
Given array,x, remove all the positive numbers and display ouput as y. Example x=[1 -2 3 -4] , output is y=[-2 -4].

3 years ago

Solved

Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

3 years ago

Solved

What percentage?
Calculate the output c as the percentage of a on b for given a and b.

3 years ago

Solved

Getting the row and column location from a matrix
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to get <http://www.mathwo...

3 years ago

Solved

Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

3 years ago

Solved

Calculate the Hamming distance between two strings
Inspired by a similar Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-dist...

3 years ago

Solved

letter yes yes & letter no no
Split a string into two strings, wherein the first string has all alphabetic letters and the second string has all the remaining...

3 years ago

Solved

Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

3 years ago

Solved

Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix Grades=[98 56 34 100 88 87] **re...

3 years ago

Solved

middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

3 years ago

Solved

Get the length of a given vector
Given a vector x, the output y should equal the length of x.

3 years ago

Solved

Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts example: a = 1, b = 2 output = 1 1.25 ...

3 years ago

Solved

Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.

3 years ago

Solved

Given a and b, return the sum a+b in c.

3 years ago

Solved

Matlab Basics - Create a row vector
Write a Matlab script to create a row vector of 10 consecutive numbers x = [1 2 3 4 5 6 7 8 9 10]

3 years ago

Solved

Space Saver
Remove all characters that are below a space in ASCII value.

3 years ago

Solved

Celsius to Kelvin
Convert Celsius degrees to Kelvin temperature.

3 years ago

Solved

Count up then down
Create a function that produces counting up from 0 up to n then down to 0 n=2 --> 0 1 2 1 0 n=3 --> ...

3 years ago

Solved

Max of a Vector
Write a function to return the max of a vector

3 years ago

Solved

Matrix to column conversion
Given a matrix of any size, convert it into a column vector. e.g A=[10 20 30; 40 50 60] then, B = [10; 40; ...

3 years ago

Solved

Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

3 years ago

Solved

MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string. For example A='harsa'; b='harish'; result '1' ...

3 years ago

Solved

Vectors counting by 2
Create a vector numbers from 7 to 15 in increments of 2

3 years ago

Solved

Change the sign of even index entries of the reversed vector
change the signs of the even index entries of the reversed vector example 1 vec = [4 -1 -2 9] ans = [9 2 -1 -4] example2...

3 years ago

Solved

Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...

3 years ago

Solved

Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

3 years ago

Solved

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

3 years ago

Solved

Return the 3n+1 sequence for n
A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

3 years ago