Solved

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

10 months ago

Solved

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

10 months ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

1 year ago

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

1 year ago

Solved

Fibonacci-Sum of Squares

Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

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

1 year ago

Question

How to recover code of an unsaved m file?

I was doing my work on a m file for last 4 hours and I did not save it. Now I accidentally turned MATLAB off and is there anyway...

2 years ago | 1 answer | 0

Question

How to make an image straightener like that of cam scanner app?

Hello, everyone, I want to make an application just like camScanner which lets the user to select the corners of the object and ...

2 years ago | 1 answer | 0

Question

Is there any built-in function to make a matrix having non-zero entries in reverse diagonal only?

I know the command eye(3) generates an identity matrix having ones in its principal diagonal but I want to make a matrix that ha...

2 years ago | 1 answer | 0

Question

How to draw a stretchable polygon on an image?

I have an image say cameraman.tif and I want to display it with a polygon plotted on it and I want the user to redefine the size...

2 years ago | 1 answer | 0

Question

How can I do this?

Hello Everyone I am doing a project based on Image Processing and I am unable to figure out that which techniques to use for my ...

2 years ago | 0 answers | 0

Answered

using hold on function in step response with subplot

You just have to a little bit of modification in your code. I have done it and it is producing the following result I hope th...

using hold on function in step response with subplot

You just have to a little bit of modification in your code. I have done it and it is producing the following result I hope th...

2 years ago | 0

Question

How to set slider's minimum value other than zero in GUI?

Hello there, I am trying to change my slider's minimum and maximum values, but I can't do it. I have tried both manually and by ...

2 years ago | 2 answers | 0

Solved

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

2 years ago

Solved

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

2 years ago

Solved

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

2 years ago

Question

How to display cell contents in MATLAB GUI dropdown menu?

Hello Everyone, I have a GUI in which I want to display the entries of a 1-by-n cell as text in a dropdown menu as available o...

2 years ago | 1 answer | 0

Solved

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

Back and Forth Rows

Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

2 years ago

Solved

Find the numeric mean of the prime numbers in a matrix.

There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

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

Return the 3n+1 sequence for n

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

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

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.

2 years ago

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

2 years ago

Solved

Getting the indices from a vector

This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

2 years ago

Solved

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

2 years ago

Solved

Return the first and last character of a string

Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

2 years ago

Solved

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

2 years ago