Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists.
x = [2 6 4 9 -10 3 1 5 -10];
So
...
1年以上 前
解決済み
Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below.
Example
x = [2 3 6 9]
then y should be
[...
1年以上 前
解決済み
Find last zero for each column
Given a numeric array of arbitrary size, return the row index of the last zero for each column. If a column contains all nonzero...
Symmetry of vector
Determine whether the vector is symmetric or not (vector could be even or odd in length).
For example:
x = [1 2 3 3 2 1] is s...
1年以上 前
解決済み
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to find the logical indices o...
Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column:
in:
...
1年以上 前
解決済み
Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...
1年以上 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
1年以上 前
解決済み
Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
then
B = [ 1 1 5 ...
1年以上 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
1年以上 前
解決済み
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use d...
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...