Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.
7ヶ月 前
解決済み
Matlab Basics II - Intervals
Write a function that takes an interval from a to b, and divides it into 5 parts
example:
a = 1, b = 2
output = 1 1.25 ...
Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits.
x = 123045;
x_vec = [1 2 3 0 4 5];
I happened upon a trick ...
7ヶ月 前
解決済み
Negative Infinity
Round the given array a towards negative infinity.
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 ...
7ヶ月 前
解決済み
Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?;
x = [1 : 0.5 : 6];
y ...
7ヶ月 前
解決済み
BASICS - sum part of vector
Please make a function, where as input you get vector "x" and and vector "c", where in "c" vector you get indexes to sum.
Examp...
Compare two input matrices
Check which input matrix has more elements. Return "1" if matrix A has more elements than matrix B. Otherwise return "0".
Exa...
7ヶ月 前
解決済み
Summation of array
Given an array, Find the sum of all of the elements in it
Examples:
Input x = [1 2 3 5; 4 5 6 7];
Output y is 33
Evaluating a polynomial
Given the following polynomial and the value for x, determine y.
y = 3x^5 – x^3 + 8x – 3
Example
x = 1
y = 3 - 1 +...
7ヶ月 前
解決済み
Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody.
Return a cell array of strings of all MATLAB keywords.
7ヶ月 前
解決済み
What's size of TV?
Many people buy TV. Usually they ask about diagonal. But also important are width and height. Let's assume that all TV have rati...
7ヶ月 前
解決済み
Back to basics 4 - Search Path
Covering some basic topics I haven't seen elsewhere on Cody.
Return a string that is the user's portion of the current search...
7ヶ月 前
解決済み
Back to basics 3 - Temp Directory
Covering some basic topics I haven't seen elsewhere on Cody.
Return a string that is the path to the system's current temp di...