Solved

Rotate a matrix for 180 degree

Rotate a matrix for 180 degree for eg: x=[1 2 3 4] y=[4 3 2 1]

7 months ago

Solved

Find the volume of cone

Find the volume of cone, when given radius(r) and height(h).

7 months ago

Solved

Matrix of almost all zeros, except for main diagonal

Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

7 months ago

Solved

Change matrix to vector

Vector is a matrix whose size is 1 x n or n x 1. Change matrix to vector. x = 4 3 5 1 ...

7 months ago

Solved

Find the sum of n squares

What is the sum of the squares of the first n integers?

7 months ago

Solved

Reverse a string

Reverse the given string. Example input = 'reverse' output = 'esrever'

7 months ago

Solved

Basic commands - rounding

make a function which will round to integer, which is nearer to zero. Example x=[-2.5 2]; y=[-2 2];

7 months ago

Solved

Change string to number

Change given string to number. (hint: there is already function) Changing from ['1234'] to [1234] is one of example

7 months ago

Solved

Append two matrix as shown below example

Append two matrix as shown below example A=[1 2; 3 4] and B=[5 6;7 8] Answer must be 1 2 5 6 3...

7 months ago

Solved

Matlab Basics - Pick out parts of a vector

Consider x a vector of length >= 7 (there are at least 7 elements in the vector, write a script that extracts the 2nd element, a...

7 months ago

Solved

Find out total non zero element of matrix

Find out Non zero element of matrix A=magic(5) 17 24 1 8 15 23 5 7 14 16 4 6...

7 months ago

Solved

Square Diagonal

If n is the given number, then make a diagonal matrix of size 2*2 with the square of that number.

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

7 months ago

Solved

Back to Basics - Find no. of elements in a matrix?

Let A be a m*n matrix. Find the total no. of elements in A ? (Hint - formula based) A = [1 2 3;4 5 6]; output = 6

7 months ago

Solved

Find out value of sine given by degree.

Find out value of sine given by degree. If theta=30, it's value must be 0.5.

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

7 months ago

Solved

Summation of array

Given an array, Find the sum of all of the elements in it Examples: Input x = [1 2 3 5; 4 5 6 7]; Output y is 33

7 months ago

Solved

Output any real number that is neither positive nor negative

Output any real number that is neither positive nor negative

7 months ago

Solved

Symmetry of vector

Determine whether the vector is symmetric or not (vector could be even or odd in length). For example: x = [1 2 3 3 2 1] is s...

7 months ago

Solved

Sum the squares of numbers from 1 to n

For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

7 months ago

Solved

Matlab Basics II - Extract last 3 elements of a vector

Let x be a vector of unknown length, we are always interested in the last 3 numbers in the vector, write a function that gives t...

7 months ago

Solved

metre to feet converter

The idea is to make a converter, which exchange meters to feets. We use a factor of 1m = 3.281*1f. so 3m are equals to 9.843 m...

7 months ago

Solved

Determine the length of a string of characters

Determine the length of a string of characters

7 months ago

Solved

Find Out sum of principal diagonal element of given matrix

Find out sum of principal diagonal element of given matrix If A=[1 0 0; 0 1 0;0 0 1], then answer must be 3.

7 months ago