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
[...
2年弱 前
解決済み
Oh Zero Zero Zero!!!
Hello all,
So you have to find the largest section of zeros in a vector and then find the length of those zeros and there start...
2年弱 前
解決済み
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...
2年弱 前
解決済み
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...
Pi Estimate 1
Estimate Pi as described in the following link:
<http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>
2年弱 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...
2年弱 前
解決済み
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displayed ...
2年弱 前
解決済み
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
2年弱 前
解決済み
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
2年弱 前
解決済み
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false.
Example...