Community Profile

# CAM

##### Last seen: 4 days ago
268 total contributions since 2012

View details...

Contributions in
View by

Solved

Create a vector whose elements depend on the previous element
The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

4 days ago

Solved

Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

10 days ago

Solved

(Linear) Recurrence Equations - Generalised Fibonacci-like sequences
This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

12 days ago

Solved

Is X a Fibonacci Matrix?
In honor of Cleve's new blog and post: <http://blogs.mathworks.com/cleve/2012/06/03/fibonacci-matrices/> Is X a Fibonacci ...

13 days ago

Solved

Rescale Scores
Each column (except last) of matrix |X| contains students' scores in a course assignment or a test. The last column has a weight...

17 days ago

Solved

Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

17 days ago

Solved

Find the Best Hotels
Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

17 days ago

Solved

Find MPG of Lightest Cars
The file |cars.mat| contains a table named |cars| with variables |Model|, |MPG|, |Horsepower|, |Weight|, and |Acceleration| for ...

17 days ago

Solved

Calculate Inner Product
Given two input matrices, |x| and |y|, check if their inner dimensions match. * If they match, create an output variable |z|...

17 days ago

Solved

Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

17 days ago

Solved

Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.&#8519;^(-&lambda;t)*cos(2πft)| where |A|, |&lambda;|, and |f| ...

17 days ago

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

18 days ago

Solved

Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

18 days ago

Solved

Solve a System of Linear Equations
*Example*: If a system of linear equations in _x&#8321_ and _x&#8322_ is: 2 _x&#8321;_ + _x&#8322;_ = 2 _x&#8321;...

18 days ago

Solved

Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

18 days ago

Solved

Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

19 days ago

Solved

Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

19 days ago

Solved

Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

19 days ago

Find max value with multiple conditions
Use logic statements for each criterion. Use logical "AND" (&) to see which elements meet all criteria. Find the max of thos...

1 month ago | 0

Could someone tell me an easy way to plot graph when kk varies from 1 to 100?
Have you considered putting all emg data columns in a cell array, with the first cell containing the x-values? That way you onl...

1 month ago | 1

Solved

Return a list sorted by number of consecutive occurrences
Inspired by Problem 38 by Cody Team. Given a vector x, return a vector y of the values in x sorted by the number of CONSECUTIVE...

1 month ago

Solved

Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

1 month ago

Solved

Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have a = [1 2 2 2 1 ...

1 month ago

Solved

Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

2 months ago

Solved

middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

2 months ago

Question

Simultaneous reading of mat file allowed?
I know it is bad to allow multiple users to write to a mat-file simultaneously (or one read while another is writing). But can ...

3 months ago | 1 answer | 0

### 1

Solved

Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

3 months ago

Solved

Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

3 months ago