Solved


Sum of diagonals elements of a matrix
Given a matrix, return the sum of all the elements across the diagonals. E.g. A = [1 2 3; 4 5 6; 7 8 9;...

9 years ago

Solved


Writing a recursive math function
Complete the recursive function RaiseToPower(). Ex: If userBase is 2 and userExponent is 4, then raisedValue is assigned wit...

9 years ago

Solved


If-then-else
Complete the function below such that if the value of x is in the range 10 to 14, inclusive, the value 18 is assigned to y. Oth...

9 years ago

Solved


Function call: Kilometers to miles
Assign rateMPH with the corresponding rate in miles per hour given a user defined rateKPH, which is a rate in kilometers per hou...

9 years ago

Solved


Returning a "greater than" vector
Given a vector, v, return a new vector , vNew, containing only values > n. For example: v=[1 2 3 4 5 6] n=3 vNew =...

9 years ago

Solved


Populating an array with a for loop
Write a for loop to populate multiplicationTable with the multiples of baseValue from 0 to 5. Ex: If baseValue is 2, then mu...

9 years ago

Solved


Convert letters to Greek letter
Write a switch statement that checks origLetter. If origLetter is 'a' or 'A', assign greekLetter with 'Alpha'. If origLetter is ...

9 years ago

Solved


frame of the matrix
Given the matrix M, return M without the external frame.

9 years ago

Solved


Next Higher Power of B
|Given a number _n_ and a base _B_ greater than 1, return the lowest integer power of _B_ that is greater than or equal to _n_. ...

9 years ago

Solved


Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...

9 years ago

Solved


Area of a disk
Find the area of a disk or circle. x= radius of the disk.

9 years ago

Solved


Average of square wave
given positive and negative peak , calculate dc level, 50% duty cycle

9 years ago

Solved


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

9 years ago

Solved


Modify an array's elements
Write a for loop that iterates from 1 to numberSamples to double any element's value in dataSamples that is less than minValue. ...

9 years ago

Solved


Square the input
Given a scalar or vector x, return the square of each element. Example x = [7 2] answer = [49 4]

9 years ago

Solved


Area of a circle
Given the radius x, y would be the area of a circle. Pi = 3.1416

9 years ago

Solved


Cody Matlab Version
What is the current Cody Matlab Release? *Output:* string *Examples:* '(R2012a)' or 'R2012a' Hint: We have mo...

9 years ago

Solved


UICBioE240 2.1
This will be useful later in the course, in conjunction to clc and clear all, what is the command to close all figure windows th...

9 years ago

Solved


Piecewise linear interpolation
Given an Mx2 vector and a row of M-1 integers, output a two column vector that linearly interpolates Y times between each succes...

9 years ago

Solved


Joining Ranges
You are given a n-by-2 matrix. Each row represents a numeric range, e.g. x = [0 5; 10 3; 20 15; 16 19; 25 25] contains...

9 years ago

Solved


Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example start with x = 1 and y = 3 end with y = 1 and x = 3 Do NOT simply r...

9 years ago

Solved


find the roots of a quadratic equation
for e.g x = [ 2 -1 -3] y = [1.5 -1]

9 years ago

Solved


Speed of car
Calculate the Speed of car given its Distance travelled and time taken in x and y respectively

9 years ago

Solved


Saving MATLAB session to a file
How to save MATLAB session to a file?

9 years ago

Solved


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

9 years ago

Solved


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 ...

9 years ago

Solved


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

9 years ago

Solved


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not ...

9 years ago

Solved


Calculate the derivative of a polynomial
Example: in = [ 1 1 1 ] out = [ 2 1 ]

9 years ago

Solved


Array of Ones
Create a 100 X 100 array of ones.

9 years ago

Load more