Joshua Saenz
統計
All
Content Feed
解決済み
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...
約3年 前
解決済み
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...
約3年 前
解決済み
Determine if input is odd
Given the input n, return true if n is odd or false if n is even.
約3年 前
解決済み
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年 前
解決済み
Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...
約3年 前
解決済み
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...
約3年 前
解決済み
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:...
約3年 前
解決済み
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...
4年弱 前
解決済み
Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.
4年弱 前
解決済み
Output any real number that is neither positive nor negative
Output any real number that is neither positive nor negative
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年弱 前
解決済み
Given a 4x4 matrix, swap the two middle columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...
4年弱 前
解決済み
Flipping
Write code that can reverse the vector without using any sort of loop. Example Given the input vector A = [ 1 2 3 4 5...
4年弱 前
解決済み
Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN. Example: input: x = [1 2 5 12 10 7] ...
4年弱 前
解決済み
Get the length of a given vector
Given a vector x, the output y should equal the length of x.
4年弱 前
解決済み
Length of the hypotenuse
Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....
4年弱 前
解決済み
Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...
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....
4年弱 前
解決済み
Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody. Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...
4年弱 前
解決済み
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.
4年弱 前
質問
Sum odd numbers in a matrix
Hello I'm a beginner and just going through some practice problems and I'm on one where I need to sum all the odd values in a ma...
4年弱 前 | 1 件の回答 | 0
1
回答解決済み
Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...
4年弱 前
解決済み
Replace Vector Elements
Replace all elements in a vector which are equal to or smaller than zero with 0.1. Example: A = [1 2 3 -1 0 2 -3 -80]; ...
4年弱 前
解決済み
Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...
4年弱 前
解決済み
Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...
4年弱 前
解決済み
Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.ⅇ^(-λt)*cos(2πft)| where |A|, |λ|, and |f| ...
4年弱 前
解決済み
Solve a System of Linear Equations
*Example*: If a system of linear equations in _x₁_ and _x₂_ is: 2 _x₁_ + _x₂_ = 2 _x₁...
4年弱 前