Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x
e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]
4年弱 前
解決済み
Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...
4年弱 前
解決済み
Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody.
Return a value equal to the number of input arguments to the fun...
4年弱 前
解決済み
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 ...
Can we make a triangle?
Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...
4年弱 前
解決済み
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...
4年弱 前
解決済み
Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...
Number of 1s in a binary string
Find the number of 1s in the given binary string.
Example. If the input string is '1100101', the output is 4. If the input stri...
4年弱 前
解決済み
Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes.
---
You may already know how to <http://www.mathworks....
Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes.
---
If you want to get a random permutation of integer...