Replace all odd numbers with NaN
Replace all odd numbers in the vector or matrix with NaN. For example, if
x = [1 3 4 5 8 11];
then return
y = [NaN Na...
Make roundn function
Make roundn function using round.
x=0.55555
y=function(x,1)
y=1
y=function(x,2)
y=0.6
y=function(x,3)
...
約9年 前
解決済み
Analyze observation data
Suppose you have the following data (A,B,C) in three-column format.
A B C
--------------------------
t=1 ...
約9年 前
解決済み
How Many Months Until It's Today Again?
Given a particular date, calculate how many months must pass before that same day of the month occurs on the same day of the wee...
約9年 前
解決済み
Change input vector
If a input vector is [3, 2, 6, 1, 6], the output vector is [3, 2, 6, 1, 6] + [1, 2, 3, 4, 5] = [4, 4, 9, 5, 11].
約9年 前
解決済み
make an eye matrix which element is 1:n
for a given input n, make an n by n matrix which contains elements 1:n
for example
input =5
output = [1 0 0 0 0;0 2 0 0 0; 0...
約9年 前
解決済み
multiple 2
function y = your_fcn_name(x)
y = 2*x;
end
約9年 前
解決済み
determine if
determine if the elements of a matrix is a nan and return true
約9年 前
解決済み
basics -making a matrix
make a matrix which contains input x as the last element.
the intervals should be +1
ex) input = 5
output= [0 1 2 3 4 5]
ex)...
約9年 前
解決済み
sum all the elements
sum all the elements in the matrix
ex) x=[1 2 3 4; 5 6 7 8; 9 10 11 12]
y=78
約9年 前
解決済み
find the 'M'
for an input x, return 1 at the location of the letter 'M'