Answered
Logical indexing when index exceeds matrix dimensions
Thank you per. It is true what you say about the positions. However, I am talking about difference in the sizes of the indexing ...

8 years ago | 0

Answered
How can I tell matlab to go back and recalculate?
Maybe with a |while| loop. Let's say that you want to recalculate if your result is |10^-2| grater/smaller from your certain va...

8 years ago | 0

| accepted

Question


Logical indexing when index exceeds matrix dimensions
I am mentioning the following example as a case of logical indexing which I only came across very recently. x = randi([1 2]...

8 years ago | 3 answers | 0

3

answers

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

8 years ago

Question


Get the facecolor of a contourf plot
I would like to find the |facecolor| of the the |contourf| patches. For example if : [X,Y,Z] = peaks; figure conto...

9 years ago | 1 answer | 0

1

answer

Answered
display several rectangles in color on your image
You can plot it! plot([x1 x1+a x1+a x1 x1], [y1 y1 y1+b y1+b y1]) where |(x1, y1)| is the starting point of your rectang...

9 years ago | 0

Answered
Help with acquiring means of different columns using on one single matlab code
* For the first question: ismember(Gender, 'Male') Will give a logical vector with true(1) the males and false(0) the f...

9 years ago | 0

| accepted

Solved


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

9 years ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

9 years ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

9 years ago

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

9 years ago

Solved


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

9 years ago

Solved


Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

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

9 years ago

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

9 years ago

Answered
Get coordinates to point
h = plot([x1,x2],[y1,y2]) x = get(h, 'xdata') % the x values y = get(h, 'ydata') % the y values

9 years ago | 0

Answered
How to convert string to numeric variable in if statement
If this is exactly what you want to do then try this: Team = {'C1' 'C2' 'C3' 'C4'} for ii=1:length(Team) swit...

9 years ago | 0

Answered
Delete rows from matrix
IN the title you mention rows. In the question you mention columns. example: A1=randi(10,64, 2200); A2=randi(10,64,...

9 years ago | 0

| accepted

Answered
find the pair of the matrix
Maybe you ask for this: D = reshape([a.' circshift(a.',-1)], [], 2); D(size(a,2):size(a,2):end,:)=[]; out =[D flip...

9 years ago | 0

| accepted

Answered
Help with Matalab code in detecting sign change in a Vector
First part: C = sign(diff(A, [],2))% size(M, N-1); %1 for positive, 0 for no change, -1, for negative Second part D...

9 years ago | 1

Answered
i have 729 data points within a particular range of lat &long. how can i reduce this to 150 without changing the range of lat&long..?
I assume that you don't care about the values in between maximum and minimum A=randi(1000, 729,1); % create an random matri...

9 years ago | 0

Answered
Handling GUI axes to display images
imshow(image, 'parent',handle.axes1)

9 years ago | 2

Answered
normalize a row vector
If I understood correctly: A=1:128; B=A/sum(A); Then: sum(B) ans = 1

9 years ago | 2

Answered
generate coordinates circle,square,rectangle
% circle r=1; % radius C=[1 1]; theta=0:2*pi/360:2*pi; % the angle m=r*[cos(theta')+C(1) sin(theta')+C(2)]; % th...

9 years ago | 1

Answered
Column-wise AND operation in all column combinations of two matrices
Thank you all for your replies!!

9 years ago | 0

Question


Column-wise AND operation in all column combinations of two matrices
Given matrix a of size |MxN| and matrix b of size |MxL| I want to get a matrix C of size |M x(N*L)| which contains the column-w...

9 years ago | 4 answers | 0

4

answers

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.

9 years ago

Question


Problem with regular expressions
Given the string: str='""A_3_1"": [""choice_0"", ""choice_1"", ""choice_2"", ""choice_3""], ""A_2_1"": [""choice_1"", "...

9 years ago | 1 answer | 0

1

answer

Question


Textscan File and ignoring the newline characters
How can I textscan a file and ignore newline characters?

9 years ago | 1 answer | 0

1

answer

Question


Find rows containing N zeros in a matrix
I have a matrix like: mat =[1 2 3; 0 0 3; 1 2 0; 0 0 0; 2 0 0]; To find a row full ...

9 years ago | 1 answer | 0

1

answer

Load more