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...
7年以上 前
解決済み
Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times.
Examples :
n=2, A=[1 2 3] -> [1 1 2 2 3 3]
n=0...
7年以上 前
解決済み
Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0.
a = 3;
b = [1,2,4];
Returns 0.
a = 3;
b = [1,...
7年以上 前
解決済み
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
7年以上 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Inpu...
7年以上 前
解決済み
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...
7年以上 前
解決済み
Reverse the vector
Reverse the vector elements.
Example:
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
7年以上 前
解決済み
Insert zeros into vector
Insert zeros after each elements in the vector. Number of zeros is specified as the input parameter.
For example:
x = [1 ...
7年以上 前
解決済み
Min of a Matrix
Return the minimum value in the given matrix.
7年以上 前
解決済み
Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x.
For instance if x=2 then y must be 1+2+3+4=10.
Prime number removal
remove all prime numbers from the input
e.g.
input =
1 2 3 4 5 6 7 8 9 10 11 12 ...
7年以上 前
質問
Focus follows mouse in 2015a
I have recently updated to R2015a on a windows 7 machine. I use focus-follows-mouse (you can change this in the registry), but ...