Solved


Easy Sequences 32: Almost Pythagorean Triples
An Almost Pythagorean Triple (abbreviated as "APT'), is a set of 3 integers in which square of the largest element, which we wil...

4 years ago

Solved


Easy Sequences 60: Almost Cube Root
The almost cube root of an integer , is the largest possible integer , such that and . For example , then , since and since th...

4 years ago

Answered
Merge selected column elements from two matrices into a new matrix
If the number of non-zeros is not constant in the combined cA,cB rows, then cT will need to be a cell array. for k=1:size(cA,1)...

4 years ago | 0

| accepted

Answered
ive tried doing it but i dont know why the plot is not right t=-2:0.1:2; if t<=-1 y=-5.*t-5; elseif t<0 y=t.^2+1; elseif t<1 y=pi.^t; elseif t>=1 y=pi+sin(pi
t=-2:.1:2; f=zeros(size(t)); f(t<=-1)=-5*(t(t<=-1))-5; f(t>-1&t<0)=t(t>-1&t<0).^2+1; f(t>=0&t<1)=pi.^(t(t>=0&t<1)); f(t>=1)...

4 years ago | 0

| accepted

Answered
If statement without loop
TR1_Ge70(TR1>TR1_Ge70(:,1))=0; for k=1:size(A,2) C(:,:,k)=A(:,k).*B; end

4 years ago | 0

Answered
sorting with respect to specific column
s=sortrows(yourMatrix,6);

4 years ago | 0

| accepted

Solved


Seperate array to small section according to its index position
Given a integer n, we can generate a sequence [0,1,2,3,4,..., 2^n-1], then we separate it to two sequence according to their ind...

4 years ago

Solved


Counting Squares
An algorithm starts with a single square and on each of its next iterations adds new squares all around the outside as shown bel...

4 years ago

Solved


How many days?!?
Christmas is coming earlier and earlier each year. Thanks to rampant commercialism and Christmas Creep, "The Twelve Days of Chr...

4 years ago

Solved


Find Missing Number
A little problem (inspired by CodeChef) for the coffee break. A friend give you an array of size n-1 integers and these int...

4 years ago

Solved


Red and green towers
Frankie has a large number of wooden cubes, painted in red and green. He is building little towers with his cubes, by stacking t...

4 years ago

Solved


Easy Sequences 8: Triangles with integer sides and prime perimeters
The triangle below is special. It has integer sides and a prime perimeter. Given an integer "n" we want to know how many t...

4 years ago

Solved


Easy Sequences 34: Modified Pascal's Triangle
Consider the integer triangle below: It follows the same ...

4 years ago

Solved


Easy Sequences 33: Web Trapped Ant
An ant is trapped on a spider web inside a can with open top. The can has a radius and height . A spider sitting on the outside...

4 years ago

Answered
Remove values from column that are close in value to each other
x=sort(x);%make sure x is sorted x(diff(x)<2)=[];

4 years ago | 1

Solved


Easy Sequences 30: Nearly Pythagorean Triangles
A Nearly Pythagorean Triangle (abbreviated as "NPT'), is an integer-sided triangle whose square of the longest side, which we wi...

4 years ago

Solved


Easy Sequences 18: Set Bits of Triple Summations
The function S(n) is defined by the following triple summations: The double brackets mean that th...

4 years ago

Solved


Easy Sequences 24: Number of Coprime Lattice Points
Given a number 'n', you were tasked to mark and count all coprime lattice points at the first quadrant bounded by the points (0,...

4 years ago

Solved


Easy Sequences 21: Combinatorial Summations
Create the function S(n), defined by the following summation: The symbol is the combination f...

4 years ago

Solved


Easy Sequences 28: Sum of Radicals of Integers
The radical of a positive integer is defined as the product of the distinct prime numbers dividing . For example, the distinct ...

4 years ago

Answered
How to change Matlab display format for numbers
Look at the options under format help format format bank

4 years ago | 0

| accepted

Solved


Easy Sequences 23: Hat Guessing Game!
Consider the following Game Show: Hats, with numbers written on each, were placed on the heads of the participants. Participant...

4 years ago

Solved


Easy Sequences 11: Factorial Digits without Trailing Zeros
Here is an easy one... It is not difficult to count the number of digits of the factorial of a given number. For example for 'n...

4 years ago

Solved


Easy Sequences 9: Faithful Pairs
A "faithful number" is a non-prime number that is one less or one more than some prime number but not both. For example, for num...

4 years ago

Solved


Easy Sequences 4: Eliminate the Days of Confusion
If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, "...

4 years ago

Solved


Determine connected components of a graph
Adjacency matrix of an undirected graph is given. Return the number of connected components in the graph.

4 years ago

Solved


Parcel Routing
Given a matrix that represent the distance along highways between major cities numbered 1 to _N_, provide the path and shortest ...

4 years ago

Solved


Classification metrics

4 years ago

Load more