Solved


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

6 years ago

Solved


Find the nearest prime number
Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

6 years ago

Solved


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

6 years ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

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

6 years ago

Solved


Pernicious Anniversary Problem
Since Cody is 5 years old, it's pernicious. <http://rosettacode.org/wiki/Pernicious_numbers Pernicious number> is an integer whi...

6 years ago

Solved


Energy of a photon
Given the frequency F of a photon in giga hertz. Find energy E of this photon in giga electron volts. Assume h, Planck's ...

6 years ago

Solved


How to subtract?
* Imagine you need to subtract one number from another using MATLAB. * You will not be using eval for this task. * Given two A...

6 years ago

Answered
For-loop instantly jump to largest value
Your for loop construct itself is incorrect. It should be for rpm1 = a:b:c where a and c are start and end limits and b ...

6 years ago | 0

Answered
how to plot output voltage graph of 6-pulse rectifier?
Simply use hold on command to hold the 6 plots on to the same figure. e.g hold on plot(y1); plot(y2); % and so on.

6 years ago | 0

Answered
I am getting error for Q
Firstly, as far as the error is concerned, *to access any element of an array, its index has to be an integer, not a real number...

6 years ago | 0

Answered
How to time-match measurements for two time series?
You can correlate the two data to find out the index of the correlation peak. Later, you can use this index to shift the indices...

6 years ago | 0

Answered
universal control unit serial port connection
Use instrfind() function to find out the status of the current port that you want to connect to. That will do.

6 years ago | 0

Answered
How can I separate a signal of same frequency but different amplitude?
The signal samples in the image looks like they are time-domain multiplexed.Try this x1 = x(1:2:end) and x2 = x(2:2:end). Don't ...

6 years ago | 0

Answered
how to filter EEG excel data(2562*11) using matlab.
There is no need to use any for loops. Just use colon operator to extract a particular column from the matrix (formed after impo...

6 years ago | 0

Answered
How to determine the distance at which two vectors intersect having their origins and their directions
You can make use of the function find() on their difference vector. That should do it.

6 years ago | 0

Solved


Shift elements of vector left
Shift elements of vector to the left. For ex. : Input_vec = [1 2 3 4 5] Output_vec = [2 3 4 5 1]

6 years ago

Solved


Average of even-numbered columns
Given a vector, find the average of even-numbered columns. e.g x = [ 4 6 8 9 1 2 7 ] y = ( 6 + 9 + 2 ) / 3

6 years ago

Solved


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

10 years ago

Solved


Find max
Find the maximum value of a given vector or matrix.

11 years ago

Solved


sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38 Find the sum of all the non-primes below the input, N.

11 years ago

Solved


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

11 years ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

11 years ago

Solved


Generate N equally spaced intervals between -L and L
Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

11 years ago

Solved


"mirror" matrix
Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

11 years ago

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

12 years ago

Solved


Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

12 years ago

Answered
Matlab help with discrete time signal
since your sequence is { ka,ka^2,ka^3,ka^4} which is {x(1) x(2) x(3) x(4) } and the sequence weights are known. hence your a= x(...

12 years ago | 0

Answered
Putting Three different functions into one program
if the functions are just based on some formulae , i mean for example it may be f(x)= some trigonometric formulae/expressions , ...

12 years ago | 0

Answered
command window data
1. If you have defined a function/looping structures for your code then all the variables will be local to that particular funct...

12 years ago | 0

| accepted

Load more