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...
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...
約1年 前
解決済み
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]
約1年 前
解決済み
Times 2 - START HERE
Try out this test problem first.
Given the variable x as your input, multiply it by two and put the result in y.
Examples:...
約1年 前
解決済み
Solve a System of Linear Equations
Example:
If a system of linear equations in x₁ and x₂ is:
2x₁ + x₂ = 2
x₁ - 4 x₂ = 3
Then the coefficient matrix (A) is:
2 ...
3年以上 前
解決済み
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 ...
4年弱 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
4年弱 前
解決済み
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 ...