Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

1年以上 前

Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

1年以上 前

Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...

1年以上 前

Need to read data from text format to matlab
I was able to reproduce your error as below: A = str2num('') % An empty character vector; Result: A = [] B = str2num([]) % An ...

1年以上 前 | 1

Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

1年以上 前

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

1年以上 前

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

1年以上 前

Find the Pattern 1

1年以上 前

Finding the shortest path
After you have found the minimum value of the function, you can simply replot over the same line in a different color. The most ...

1年以上 前 | 0

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.

1年以上 前

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

1年以上 前

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

1年以上 前

Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

1年以上 前

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

1年以上 前

Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

1年以上 前

Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

1年以上 前

Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

1年以上 前

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

1年以上 前

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

1年以上 前

Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

1年以上 前

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

1年以上 前

it says the right side does not equal to the left i dont know what should i do can anyone help me pls?
If the error says "Unable to perform assignment because the left and right sides have a different number of elements" the issue ...

1年以上 前 | 0

how to get matlab to disply zero as the last value
a,b, and h are 18x1 so you'll only get 18x1 unless you add a zero at the end. You can do that in a few ways: x(19)=0; %or x(...

1年以上 前 | 1

| 採用済み

How can I plot coordinates up on a map?
You can use the hold command to plot two things to the same figure. imshow('map_image') hold on plot(points_of_interest_x,poi...

1年以上 前 | 1

Saving image in correct format or how do I save only image-part of the figure?
This answer by Adam Danz shows how you can remove the borders and interactive parts of the figure window. After you've done so,...

1年以上 前 | 1

Index exceeds the number of array elements(3)
The error Index exceeds the number of array elements (3). This means that you are asking for an element beyond the boundaries ...

1年以上 前 | 0

How to supply perticular varargin entries of the 'main_function(varargin)' to a 'subfunction(varargin_new)'?
Solution When you call the original function, you do so with original_function(arg1,arg2,arg3,arg4,..) Using varargin lets ...

1年以上 前 | 1

| 採用済み

How to import a column from an Excel file?
Since it seems that you just need to get rid of the NaN values, try using logical indexing with the isnan command. p_time = p_t...

1年以上 前 | 1

| 採用済み

Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...

2年以上 前