# Sushma Swaraj

### MathWorks

Last seen: 12 mesi fa Attivo dal 2023

Followers: 0   Following: 0

I am an Engineering Development Group Intern at MathWorks.

All

#### Feeds

Visto da

Risolto

Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

12 mesi fa

Risolto

Angle between two vectors
You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

12 mesi fa

Risolto

Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

12 mesi fa

Risolto

Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

12 mesi fa

Risolto

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 = ...

12 mesi fa

Risolto

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...

12 mesi fa

Risolto

Calculate the Levenshtein distance between two strings
This problem description is lifted from http://en.wikipedia.org/wiki/Levenshtein_distance. The Levenshtein distance between two...

12 mesi fa

Risolto

Transpose of matrix
Transpose of matrix as per test cases

12 mesi fa

Risolto

Make a vector of prime numbers
Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

12 mesi fa

Risolto

Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

12 mesi fa

Risolto

Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

12 mesi fa

Risolto

Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

12 mesi fa

Risolto

Return area of square
Side of square=input=a Area=output=b

12 mesi fa

Risolto

Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

12 mesi fa

Risolto

Test for balanced parentheses
Given the input inStr, give the boolean output out indicating whether all the parentheses are balanced. Examples: * If ...

12 mesi fa

Risolto

Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

12 mesi fa

Risolto

Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

12 mesi fa

Risolto

Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displayed ...

12 mesi fa

Risolto

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

12 mesi fa

Risposto
How to crop 1 inch
Hi, We use the 'imcrop' function to crop an image. % Read the image image = imread('your_image.jpg'); % Replace 'your_image.jp...

12 mesi fa | 0

Risolto

Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

12 mesi fa

Risolto

Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

12 mesi fa

Risolto

Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

12 mesi fa

Risolto

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

12 mesi fa

Risolto

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...

12 mesi fa

Risolto

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...

12 mesi fa

Risolto

Find the peak 3n+1 sequence value
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...

12 mesi fa

Risolto

Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

12 mesi fa

Risolto

Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false. Example...

12 mesi fa

Risolto

Return a list sorted by number of occurrences
Given a vector x, return a vector y of the unique values in x sorted by the number of occurrences in x. Ties are resolved by a ...

12 mesi fa