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...
3年弱 前
解決済み
Is My Wife Wrong?
Answer the question.
(see also <http://www.mathworks.com/matlabcentral/cody/problems/149-is-my-wife-right Problem 149: Is my ...
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
3年弱 前
解決済み
Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros.
Exam...
3年弱 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.
3年弱 前
解決済み
Create a Matrix of Zeros
Given an input x, create a square matrix y of zeros with x rows and x columns.
3年弱 前
解決済み
Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...
3年弱 前
解決済み
Create times-tables
At one time or another, we all had to memorize boring times tables. 5 times 5 is 25. 5 times 6 is 30. 12 times 12 is way more th...
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...