Solved


Vector creation using linspace
Create a vector y containing n uniformly spaced values between a and b, with a < b. Use linspace.

5 månader ago

Solved


Matrix indexing with two vectors of indices (★★)
(copy of Prob 589) Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if...

5 månader ago

Solved


Matrix Indexing
Given a matrix A and scalars r,c,i, find the product of two elements, with the first element located at row r and column c (doub...

5 månader ago

Solved


Doubling elements in a vector (★★)
(copy of prob. 1024) Given the vector A, return B in which all numbers in A are doubling. So for: A = [ 1 5 8 ] t...

5 månader ago

Solved


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

5 månader ago

Solved


Create a vector of the first n odd numbers (★)
If n = 10, your program should return a vector y, where y = [1 3 5 7 9 11 13 15 17 19].

5 månader ago

Solved


What's Your BMI?
Find the body mass index. For reference, please refer to Wikipedia here: <http://en.wikipedia.org/wiki/Body_mass_index body ...

5 månader ago

Solved


Matrix convolution
A certain convolution step involves an elementwise multipication between two 3x3 matrices and taking the resulting sum of the el...

5 månader ago

Solved


Sum of elements of a vector (★★★)
Given any vector x = [x1, x2, x3, ... xn], compute the sum of its elements. Thus, if x = [ 1 3 -2 5 ], then the sum of its el...

5 månader ago

Solved


Average of corner elements of a matrix (★★)
(copy of prob 2235) Calculate the average of corner elements of a matrix. e.g. x=[1 2 3; 4 5 6; 7 8 9;] avg = (1+3+7+9)...

5 månader ago

Solved


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

5 månader ago

Solved


Create a vector of the first n natural numbers (★)
If n = 7, your program should return a vector y, where y = [1 2 3 4 5 6 7].

5 månader ago

Solved


Vector raised to a power, element-wise (★)
Given a vector A and a number x, raise each element of the vector to the power of x. Thus, if A = [2 5 7 1] and x = 0.5, then ...

5 månader ago

Solved


Create logarithmically spaced values (★)
Given three numbers a,b,n with b>a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, ...

5 månader ago

Solved


Element-wise vector product (★)
Given two vectors x and y, compute their element-wise product z. Thus, if x = [1 3 5] and y = [0.5 -1 2], then z = [1*0.5...

5 månader ago

Solved


area of an annulus
Given the diameter d of the inner circle of the annulus. Given length z of a chord of the outer circle of the annulus. This chor...

5 månader ago

Solved


Count photos
Given n people, everyone must have pictures taken with everyone, each photo includes only two persons, please count the total nu...

5 månader ago

Solved


square root
Find square root of given number

5 månader ago

Solved


Extract a specific part of matrix!
In the given matrix, extract element that have odd rows and column number. For example A=[1 4 2 3 5] B=extractodd(A);...

5 månader ago

Solved


Reshape a Vector
Write a function that accept three inputs. The first one is a row vector S. The second and third arguments are m and n which de...

5 månader ago

Solved


Find the maximum two numbers of every column of a matrix
Find the maximum two numbers of every column of a matrix. Example: If we input a matrix A = [ 1 2 4 6 0 3 ...

5 månader ago

Solved


Logarithmically spaced vector creation using linspace
Create a vector y containing n logarithmically spaced values between a and b, with a < b. Avoid using logspace and use the linsp...

5 månader ago

Solved


Where is 1?
There is a 3d matrix [A] that consist of many zeros and only one. A=zeros(100,100,100); i=randi(100); j=randi(100); ...

5 månader ago

Solved


square of a number
find square of a given number

5 månader ago

Solved


cube of number
find cube of number

5 månader ago

Solved


Analyze observation data
Suppose you have the following data (A,B,C) in three-column format. A B C -------------------------- t=1 ...

5 månader ago

Solved


Reverse Calculator
Use this reverse calculator and give correct output Its simple, In my Reverse calculator if you press 0 it will be considered...

9 månader ago

Solved


length of string on cylinder
A cylinder H cm high has a circumference of C cm. A string makes exactly N complete turns round the cylinder while its two ends ...

9 månader ago

Solved


Cosine frequency doubler
Given an input vector containing a cosine wave of unknown frequency, produce an output vector of the same length containing a co...

9 månader ago

Load more