Solved


Basic commands - Least common multiple
Make a function which will return least common multiple of "a" and "b" Example: a=8; b=6; y=24;

9 years 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

9 years ago

Solved


Resort number using given index!
Resort matrix [a] using given index [b]. For example, if a=[2 5 3 5]; b=[4 1 2 3]; , the result is [5 2 5 3]. (hint: y...

9 years ago

Solved


Sort matrix a according to ascending order of B!
To be specific, A=[9 3 1 3] B=[1 3 2 4] are provided, ascending sorting of B is [B(1) B(3) B(2) B(4)]. Thus ...

9 years ago

Solved


Extract a part of matrix!
There is matrix A A=[1 2 3; 4 5 6; 7 8 9] Extract a part of matrix A from (2,2) to (3,3). Result should...

9 years ago

Solved


Calculate solution of given polynomial
For example, y=function([3 -2 -4]) In here, input vector indicate 3*x^2-2*x-4, y is solution of former equation. y=[1.5...

9 years ago

Solved


ESEMPIO
controllo uso funzioni

9 years ago

Answered
Fitting experimental data to find a function
You can try polyfit function or other curve fit function, i.e. nlinfit or lsqcurvefit,to find proper equation. you also use cft...

9 years ago | 0

| accepted

Solved


i forgot to use capital I
When referring to yourself you should write "I" (capital) and not "i". So correct the input string x, but be aware that other u...

9 years ago

Solved


Bubble sort
Write your own bubble sort function ( <https://en.wikipedia.org/wiki/Bubble_sort>) to sort all elements in x in ascending order....

9 years ago

Answered
Loop backwards and select subset of rows that meet criteria
if you want to use loop, it is showed below: tindex = find(A(:,1)==t); for j = tindex:-1:2 if(A(j,1)-A(j-1,1)==1)...

9 years ago | 1

| accepted

Solved


extract part elements of matrix into one new matrix
Given a matrix, includes different elements(plus, minus and zero), extract the nonzero elements and form a new matrix. for examp...

9 years ago

Solved


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

9 years ago

Solved


Avengers Assemble!
Given matrix with so many zeroes, trim those zeroes and output a matrix joining all nnz elements Example: input = [0 0 0 0 0...

9 years ago

Solved


Finding two missing number in 1 to n array
You are given an array of numbers from 1 to n with two missing numbers. Return the two missing numbers. Input: x=[5 2 0 1 ...

9 years ago

Answered
Replace rows with NaN only if there are more than two continous zero values in the same column
First, you can find the column with continous zeros(more than two), then find the index for replacement with nan. for example:...

9 years ago | 0

Problem


extract part elements of matrix into one new matrix
Given a matrix, includes different elements(plus, minus and zero), extract the nonzero elements and form a new matrix. for examp...

9 years ago | 0 | 46 solvers

Answered
Loop backwards and select subset of rows that meet criteria
you can solve it without loop, e.g B = find(diff(A(1:find(A(:,1)==t),1))~=1); result = A(B(end)+1:find(A(:,1)==t)-1,:);

9 years ago | 0

Solved


Remove all the columns contains only zero
Remove the column from the matrix which has only zeros . Refer the Example below a= 1 0 3 0 23 0 56 0 1 ...

9 years ago

Solved


Calculate the hypotenuse of a right triangle without using ^ and sqrt ()
Find out the hypotenuse of right triangle. Say a = 4, b = 3 then c = 5 Please don't use ^ and sqrt() function.

9 years ago

Solved


Solve cosine without cos(x)
Solve cos(x). The use of the function cos() and sin() is not allowed.

9 years ago

Solved


Solve sin(x) without sin(x)
Calculate y = sin(x) x = 0 -> y= 0 without the use of sin(x) or cos(x)

9 years ago

Solved


Create vector as shown in test cases
Create vector as shown in test cases

9 years ago

Solved


Delete useless part of data
When someone deals with big data. if the person delete useless part, calculation will be more faster than before deleting. De...

9 years ago

Solved


Modified run-length companion vector
Given a vector x, return a vector that indicates the run length of any value in x. Each element in output vector shows how many ...

9 years ago

Solved


Find index of a string in a cell array
Write a function that finds the index at which the cell array of strings C contains the exact string S. So if C = {'twe...

9 years ago

Solved


Clipper Function
Create a function that emulates a clipper circuit Given sin wave, t and the constant value for clipping, and the direction to re...

9 years ago

Solved


Make equation that can express relationship!
Observed data [y] that vary with [x]. Unfortunately, [y] including small amount of errors. x=[1 2 3 4 5 6] y=[2.16 4.97 ...

9 years ago

Solved


Removing vibration!
There are [y] that vary with [x] but y including small useless vibration. x=1:10 y=[1.71 2.03 3.28 4.05 5.10 6.82 7.69 8.3...

9 years ago

Solved


Make 3d matrix from other matrix
A=[1 1;2 2]; B=[2 2;3 3]; C=[0 0;1 3]; Using given three matrix, make 3 dimensional matrix [D] by stacking.

9 years ago

Load more