Solved

Project Euler: Problem 6, Natural numbers, squares and sums.

The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

7 months ago

Answered

Plot polygons defined by the specific points on map

There are many ways to do this, but this works. lats= [30 32 31; 29 30 31]; lons = [-102 -103 -104; -100 -103 -101]; [numrows...

Plot polygons defined by the specific points on map

There are many ways to do this, but this works. lats= [30 32 31; 29 30 31]; lons = [-102 -103 -104; -100 -103 -101]; [numrows...

7 months ago | 0

Submitted

wetbulb

Calculates the wetbulb temperature given pressure, dewpoint, and temperature

7 months ago | 2 downloads |

Solved

I Plead the Fifth

Write a function to provide a yes or no answer to the input string. However, it must plead the 5th amendment (return an empty st...

7 months ago

Answered

Image registration with imwarp without scaling?

Try using imregtform with transformType set to rigid.

Image registration with imwarp without scaling?

Try using imregtform with transformType set to rigid.

7 months ago | 0

Answered

Why doesnt int2str return string

It's turned your value into a char, not a string. ischar(int2str(F{1,4})) should return true If you look at the function hel...

Why doesnt int2str return string

It's turned your value into a char, not a string. ischar(int2str(F{1,4})) should return true If you look at the function hel...

7 months ago | 0

| accepted

Answered

find finite numbers in B using logic indexing ?

B_finite_only = B(isfinite(B)); B_finite_only_sum = sum(B_finite_only);

find finite numbers in B using logic indexing ?

B_finite_only = B(isfinite(B)); B_finite_only_sum = sum(B_finite_only);

7 months ago | 0

| accepted

Answered

random letter bother upper & lower case

This is a fun puzzle. Upper-case letters run of 65-90 in an ASCII table and lower-case runs from 97 to 122. You can use char to ...

random letter bother upper & lower case

This is a fun puzzle. Upper-case letters run of 65-90 in an ASCII table and lower-case runs from 97 to 122. You can use char to ...

7 months ago | 1

| accepted

Answered

How to obtain indices of cell arrays?

There might be an easier way to do this, but it works. % get the indices of all non-empty cells [row,col] = find(cellfun(@(x) ...

How to obtain indices of cell arrays?

There might be an easier way to do this, but it works. % get the indices of all non-empty cells [row,col] = find(cellfun(@(x) ...

7 months ago | 0

| accepted

Answered

How do I convert a 3x1 cell to a 1x3

The transposition operator will work. a={1,2,3}; % 1x3 cell a = a'; % a now a 3x1 cell a = a'; % a is a 1x3 cell again

How do I convert a 3x1 cell to a 1x3

The transposition operator will work. a={1,2,3}; % 1x3 cell a = a'; % a now a 3x1 cell a = a'; % a is a 1x3 cell again

7 months ago | 0

Answered

How to Increase the rectangular block marker in legend in bar plot

Better design practice is to label the bars directly rather than keeping the label information off the the side in a legend box ...

How to Increase the rectangular block marker in legend in bar plot

Better design practice is to label the bars directly rather than keeping the label information off the the side in a legend box ...

7 months ago | 0

Answered

How to define both integer and decimal increment in one for loop?

I'm not clear on what you're looking for. Do you want something like this: span1 = 0:0.1:1; span2 = 3:2:30; span = [span1 spa...

How to define both integer and decimal increment in one for loop?

I'm not clear on what you're looking for. Do you want something like this: span1 = 0:0.1:1; span2 = 3:2:30; span = [span1 spa...

7 months ago | 0

Answered

Indexing all the row data for each column

For a 2D matrix, you can access a row as follows: % Matlab indexing is row major % return single row of matrix A A(1,:) A(2,...

Indexing all the row data for each column

For a 2D matrix, you can access a row as follows: % Matlab indexing is row major % return single row of matrix A A(1,:) A(2,...

7 months ago | 0

Solved

Mysterious digits operation (easy)

What is this digit operation? 0 -> 0 1 -> 9 121 -> 9 44 -> 6 15 -> 5 1243 -> 7 ...

9 months ago

Solved

Set a diagonal

Given a matrix M, row vector v of appropriate length, and diagonal index d (where 0 indicates the main diagonal and off-diagonal...

9 months ago

Solved

Determine the number of odd integers in a vector

Determine the number of unique odd integers in a vector. Examples: Input x = [2 5 8 3 7 1]; Output y = 4; Inp...

9 months ago

Solved

String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values

<http://www.mathworks.com/help/matlab/characters-and-strings.html String array> and cell array are two types of containers for s...

9 months ago

Solved

Cell Counting: How Many Draws?

You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...

9 months ago

Solved

Convert a Cell Array into an Array

Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

9 months ago

Solved

Remove element(s) from cell array

You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....

9 months ago

Solved

Split a string into chunks of specified length

Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...

9 months ago

Solved

Fix the last element of a cell array

Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

9 months ago

Solved

Can we make a triangle?

Given three positive number, check whether a triangle can be made with these sides length or not. remember that in a triangle su...

9 months ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex

Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

9 months ago

Solved

Height of a right-angled triangle

Given numbers a, b and c, find the height of the right angled triangle with sides a and b and hypotenuse c, for the base c. If a...

9 months ago

Solved

Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

9 months ago

Solved

Find my daddy long leg (No 's')

Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

9 months ago

Solved

Approximation of Pi

Pi (divided by 4) can be approximated by the following infinite series: pi/4 = 1 - 1/3 + 1/5 - 1/7 + ... For a given numbe...

10 months ago

Solved

Given a square and a circle, please decide whether the square covers more area.

You know the side of a square and the diameter of a circle, please decide whether the square covers more area.

10 months ago

Solved

Perimeter of a semicircle

Given the diameter d, find the perimeter of a semicircle

10 months ago