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...
6年弱 前
解決済み
Problem for beginners
Suppose that x is a column vector, with at least a length of 6. Delete the 2., 6., and the second last row.
Example:
X=[1;2;3...
6年弱 前
解決済み
Mid-term report
You just got your mid-term report, but it's full of ones and twos :(. So before you give it to your parents, you change it, in o...
6年弱 前
解決済み
Simple Matrix
Make the following matrix without typing it in one by one.
[1 2 3;
2 4 6;
4 8 12]
x=[1 2 3].
6年弱 前
解決済み
Box
Give the volume of a box, x is equal to the body diagonal.
6年弱 前
解決済み
Stairs
Make an n by n matrix, where the elements are ones and zeros. In the main diagonal, and under that, there should be only ones (...
6年弱 前
解決済み
Problem for beginners
M is a nxm matrix. Swap the fist and the second last column with eachother.
X=[1 2 3;4 5 6;7 8 9]
Y=[2 1 3;5 4 6;8 7 9]
Square
X is a number, write a code, where Y should be the square of X.
6年弱 前
解決済み
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
6年弱 前
解決済み
Convert a vector into numbers
Suppose a vector x = [ 1 2 4 7] is given. You have to convert this vector into string number y = '1247'.
Examples
x = [ 1...
6年弱 前
解決済み
Convert from Base 10 to base 5
Convert the input number from base 10 into base 5:
for example:
if a(in base 10)= 5
then a(in base 5)= 10
6年弱 前
解決済み
Convert a vector into a number
This is a sub problem related to this problem:
<http://www.mathworks.com/matlabcentral/cody/problems/621-cryptomath-addition>...
6年弱 前
解決済み
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
6年弱 前
解決済み
Max of a Vector
Write a function to return the max of a vector
Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smalle...