Solved

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

2 years ago

Solved

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

2 years 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,....

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

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

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

2 years ago

Solved

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

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

2 years ago

Solved

Find common elements in matrix rows

Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

2 years ago

Solved

Determine whether a vector is monotonically increasing

Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

2 years ago

Solved

Make a checkerboard matrix

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

2 years ago

Solved

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

2 years ago

Solved

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

2 years ago

Answered

Index exceeds the number of array elements (1).

You are attempting to access an index of x1 that does not exist. index=randi([200000,300000],1,N_measurements); assigns a rand...

Index exceeds the number of array elements (1).

You are attempting to access an index of x1 that does not exist. index=randi([200000,300000],1,N_measurements); assigns a rand...

2 years ago | 0

Answered

Combine logical cell array based on 'or' condition

You could do something like this. C{1,1} = logical([1;0;0;0;0]); C{1,2} = logical([0;1;0;0;0]); C{1,3} = logical([0;0;1;0;0])...

Combine logical cell array based on 'or' condition

You could do something like this. C{1,1} = logical([1;0;0;0;0]); C{1,2} = logical([0;1;0;0;0]); C{1,3} = logical([0;0;1;0;0])...

2 years ago | 0

Answered

Consider Preallocating for Speed

You just need to initialize your vectors before entering the for loops. Something like the below sample would satisfy the preall...

Consider Preallocating for Speed

You just need to initialize your vectors before entering the for loops. Something like the below sample would satisfy the preall...

2 years ago | 0

Question

Inconsistent Figure Behavior if Saved While Figure is Visible vs Saved While Figure is Hidden

I have run into an issue where I get a different saved png output if I save a figure while it is set to visible compared to when...

2 years ago | 1 answer | 0