Resuelto


Count the non-zero elements along the diagonals that are immediately next to the main diagonal
Suppose, you are being told to write a matrix, *a* as input in MATLAB with having the possibility of containing zero and non-zer...

casi 4 años hace

Pregunta


Out of memory Problem [Problem 2 , Project Euler (Sum of even Fibonacci numbers)]
%When i tried x=597455000 it straightly said, out of memory problem. %How can i fix this problem ? %Give me some advices fu...

casi 4 años hace | 3 respuestas | 0

3

respuestas

Resuelto


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

casi 4 años hace

Resuelto


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

casi 4 años hace

Resuelto


Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

casi 4 años hace

Resuelto


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

casi 4 años hace

Resuelto


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

casi 4 años hace

Pregunta


Sorting an array of numbers in descending order by using while loop
I wrote the code to sort number in descending order but my code failed to do so (actually i was the failure lol). Example: Cons...

casi 4 años hace | 2 respuestas | 0

2

respuestas

Resuelto


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

casi 4 años hace

Resuelto


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

casi 4 años hace

Resuelto


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

casi 4 años hace

Resuelto


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

casi 4 años hace

Resuelto


Convert given decimal number to binary number.
Convert given decimal number to binary number. Example x=10, then answer must be 1010.

casi 4 años hace

Resuelto


Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

casi 4 años hace

Resuelto


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

casi 4 años hace

Pregunta


Unable to perform assignment because the indices on the left side are not compatible with the size of the right side
I am confused yet . I hoped to get string (i dont know what i have to say character or string) values for every matrix elements...

casi 4 años hace | 1 respuesta | 0

1

respuesta

Resuelto


Matlab Basics - Rounding III
Write a script to round a large number to the nearest 10,000 e.g. x = 12,358,466,243 --> y = 12,358,470,000

casi 4 años hace

Resuelto


Height of a 3D Pyramid
If a pyramid is made with one(1). What will be the height of the pyramid of square shaped base(n*n)? where input is n.

casi 4 años hace

Resuelto


Height of a right-angled triangle
Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

casi 4 años hace

Resuelto


Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x. Examples: Input x = [1 2 3 4] Output y is 6 Input...

casi 4 años hace

Resuelto


Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...

casi 4 años hace

Resuelto


Remove the vowels
Remove all the vowels in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill' Output s2 is 'Jck nd Jll wn...

casi 4 años hace

Problema


Count the non-zero elements along the diagonals that are immediately next to the main diagonal
Suppose, you are being told to write a matrix, *a* as input in MATLAB with having the possibility of containing zero and non-zer...

casi 4 años hace | 0 | 28 solvers

Resuelto


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

casi 4 años hace

Resuelto


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

casi 4 años hace

Problema


Where do the maximum number belongs within a 3-D matrix?
Suppose, you are given two variables *a* and *b* as inputs in 2-D format. Find out, where do the maximum number belongs (as out...

casi 4 años hace | 1 | 20 solvers

Resuelto


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

casi 4 años hace

Resuelto


Calculate the centroid of a triangle
Info: https://en.wikipedia.org/wiki/Centroid Example Input: x = [0 0 1]; % x-coordinate y = [0 1 0]; % y-coordinat...

casi 4 años hace

Resuelto


Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

casi 4 años hace

Resuelto


Calculate the area of a triangle between three points
Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

casi 4 años hace

Cargar más