Answered

Problem with code when create a matrix in Maltab

Clear the variables before starting. You may write clear all in the beginning of your code

Problem with code when create a matrix in Maltab

Clear the variables before starting. You may write clear all in the beginning of your code

etwa 2 Monate ago | 0

| accepted

Answered

Symbolic Vector ODE numerical solution

in your equation for 'eq', if you are looking for double differentiation then it should be eq = diff(theta, t, 2) - cos(theta)...

Symbolic Vector ODE numerical solution

in your equation for 'eq', if you are looking for double differentiation then it should be eq = diff(theta, t, 2) - cos(theta)...

etwa 2 Monate ago | 0

Solved

Project Euler: Problem 7, Nth prime

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the Nth prime nu...

etwa 2 Monate ago

Solved

Mersenne Primes vs. All Primes

A Mersenne prime (M) is a prime number of the form M = 2^p - 1, where p is another prime number. <https://www.mathworks.com/matl...

etwa 2 Monate ago

Solved

Sophie Germain prime

In number theory, a prime number p is a *Sophie Germain prime* if 2p + 1 is also prime. For example, 23 is a Sophie Germain prim...

etwa 2 Monate ago

Solved

Find nearest prime number less than input number

Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

etwa 2 Monate ago

Solved

Mersenne Primes

A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

etwa 2 Monate ago

Solved

Largest Twin Primes

<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...

etwa 2 Monate ago

Solved

Make a vector of prime numbers

Input(n) - length of vector with prime numbers Output(v) - vector of prime numbers Example: * n=1; v=2 * n=3; v=[2 3 5...

etwa 2 Monate ago

Solved

Find the next prime number

Find the next prime number or numbers for given n. For example: n = 1; out = 2; or n = [5 7]; out = [7 11]; ...

etwa 2 Monate ago

Solved

Perfect Square or not

find Given input x is perfect square or not,if yes then output y=1.else y=0

etwa 2 Monate ago

Solved

multiply by three

Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

etwa 2 Monate ago

Solved

Sorted highest to lowest?

Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

etwa 2 Monate ago

Solved

Pentagonal Numbers

Your function will receive a lower and upper bound. It should return all pentagonal numbers within that inclusive range in ascen...

etwa 2 Monate ago

Solved

Alternating sum

Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

etwa 2 Monate ago

Solved

Divide by 4

Given the variable x as your input, divide it by four and put the result in y.

etwa 2 Monate ago

Solved

Reverse the elements of an array

Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

etwa 2 Monate ago

Solved

First N Perfect Squares

*Description* Return the first N perfect squares *Example* input = 4; output = [ 1 4 9 16 ];

etwa 2 Monate ago

Solved

Compute a dot product of two vectors x and y

x and y are input vectors, d is a number and contains their dot product

etwa 2 Monate ago

Solved

Make one big string out of two smaller strings

If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

etwa 2 Monate ago

Solved

Bottles of beer

Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

etwa 2 Monate ago

Solved

Too mean-spirited

Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

etwa 2 Monate ago

Solved

How to find the position of an element in a vector without using the find function

Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

etwa 2 Monate ago

Solved

The Hitchhiker's Guide to MATLAB

Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

etwa 2 Monate ago

Solved

Simple equation: Annual salary

Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

etwa 2 Monate ago

Solved

ASCII Birthday Cake

Given an age and a name, give draw an ASCII birthday cake. For example, given the name "CODY" and the age 5, return a string wit...

etwa 2 Monate ago

Answered

Finding Maximum Value of a Table/Categorical Array

first convert categorical to numeric array : tmax = str2double(cellstr(tmax)); tmax(tmax == 'NA') = NaN; max(tmax) convert t...

Finding Maximum Value of a Table/Categorical Array

first convert categorical to numeric array : tmax = str2double(cellstr(tmax)); tmax(tmax == 'NA') = NaN; max(tmax) convert t...

etwa 2 Monate ago | 0

| accepted

Solved

Recaman Sequence - II

Take an arbitrary starting point as input and create Recaman Sequence. Then find the 1, return its index. For example: if n =...

etwa 2 Monate ago