Answered

Pairwise distance between two matrices of 3 columns and 1911 rows.

Sounds like you need to do the sum over the second dimension of (A-B).^2; that is, to sum the sqaured differences of positions i...

Pairwise distance between two matrices of 3 columns and 1911 rows.

Sounds like you need to do the sum over the second dimension of (A-B).^2; that is, to sum the sqaured differences of positions i...

27 days ago | 1

Answered

Extraction from the double cell?

There seems to be some confusion about which variables are character arrays and which are doubles. For instance, in this line: ...

Extraction from the double cell?

There seems to be some confusion about which variables are character arrays and which are doubles. For instance, in this line: ...

1 month ago | 0

Answered

plot title including _

You may try setting the title's interpreter to 'none': title(fname,'Interpreter','none');

plot title including _

You may try setting the title's interpreter to 'none': title(fname,'Interpreter','none');

1 month ago | 0

Answered

Index exceeds the number of array elements (2).

This error happens the second time through the while loop (that is, i == 3). The cause of the error is that Thta only has 2 elem...

Index exceeds the number of array elements (2).

This error happens the second time through the while loop (that is, i == 3). The cause of the error is that Thta only has 2 elem...

1 month ago | 0

Answered

Plotting in a 3D space

This will plot a line segment from the origin to the point (1,0,-1): plot3([0 r(1)],[0 r(2)],[0 r(3)]);

Plotting in a 3D space

This will plot a line segment from the origin to the point (1,0,-1): plot3([0 r(1)],[0 r(2)],[0 r(3)]);

1 month ago | 0

| accepted

Answered

'inpolygon' returns zeros logical variable (R2019b, Win10)

Note that longitude is horizontal and latitude is vertical, so you'd need to swap LAT and LON in your call to inpolygon. (Like y...

'inpolygon' returns zeros logical variable (R2019b, Win10)

Note that longitude is horizontal and latitude is vertical, so you'd need to swap LAT and LON in your call to inpolygon. (Like y...

1 month ago | 1

| accepted

Answered

How to delete the ellipse of the previous state

One way might be to turn hold off before plotting your ellipse(s). If you change this: axes(handles.axes1) hold on to this: ...

How to delete the ellipse of the previous state

One way might be to turn hold off before plotting your ellipse(s). If you change this: axes(handles.axes1) hold on to this: ...

1 month ago | 1

Answered

how to read specified letters from ascii file

inputFileName = 'C:\input.txt'; outputFileName = 'C:\output.txt'; fileID = fopen(inputFileName,'r'); A = fread(fileID,'*cha...

how to read specified letters from ascii file

inputFileName = 'C:\input.txt'; outputFileName = 'C:\output.txt'; fileID = fopen(inputFileName,'r'); A = fread(fileID,'*cha...

1 month ago | 0

| accepted

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

1 month ago

Solved

Sum of series VII

What is the sum of the following sequence: Σ(km^k)/(k+m)! for k=1...n for different n and m?

1 month ago

Solved

Sum of series VI

What is the sum of the following sequence: Σk⋅k! for k=1...n for different n?

1 month ago

Solved

Sum of series V

What is the sum of the following sequence: Σk(k+1) for k=1...n for different n?

1 month ago

Solved

Sum of series IV

What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

1 month ago

Solved

Sum of series III

What is the sum of the following sequence: Σ(2k-1)^3 for k=1...n for different n?

1 month ago

Solved

Sum of series II

What is the sum of the following sequence: Σ(2k-1)^2 for k=1...n for different n?

1 month ago

Solved

Sum of series I

What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

1 month ago

Answered

How to compare columns of array in "if else" statement

FlagData(FlagData(:,1) == 0 & FlagData(:,2) > 0,3) = NaN;

How to compare columns of array in "if else" statement

FlagData(FlagData(:,1) == 0 & FlagData(:,2) > 0,3) = NaN;

1 month ago | 0

| accepted

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

1 month ago

Solved

There are 10 types of people in the world

Those who know binary, and those who don't. The number 2015 is a palindrome in binary (11111011111 to be exact) Given a year...

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

1 month ago

Solved

Find out sum and carry of Binary adder

Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

1 month ago

Solved

Convert given decimal number to binary number.

Convert given decimal number to binary number. Example x=10, then answer must be 1010.

1 month ago

Solved

Find a Pythagorean triple

Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

1 month ago

Solved

Length of a short side

Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

1 month ago

Solved

Side of a rhombus

If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

1 month ago

Solved

Dimensions of a rectangle

The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

1 month ago

Solved

Is this triangle right-angled?

Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

1 month ago

Solved

Is this triangle right-angled?

Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

1 month ago