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

oltre 10 anni fa | 0

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

oltre 10 anni fa | 0

| accettato

Domanda


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

oltre 10 anni fa | 3 risposte | 0

3

risposte

Risolto


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

oltre 10 anni fa

Domanda


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

quasi 11 anni fa | 1 risposta | 0

1

risposta

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

quasi 11 anni fa | 0

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

quasi 11 anni fa | 0

| accettato

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

Risolto


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

quasi 11 anni fa

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

quasi 11 anni fa | 0

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

quasi 11 anni fa | 0

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

quasi 11 anni fa | 0

| accettato

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

quasi 11 anni fa | 0

| accettato

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

quasi 11 anni fa | 1

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

quasi 11 anni fa | 0

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

quasi 11 anni fa | 2

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

quasi 11 anni fa | 2

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

quasi 11 anni fa | 1

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

circa 11 anni fa | 0

Domanda


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

circa 11 anni fa | 4 risposte | 0

4

risposte

Risolto


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.

circa 11 anni fa

Domanda


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

circa 11 anni fa | 1 risposta | 0

1

risposta

Domanda


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

circa 11 anni fa | 1 risposta | 0

1

risposta

Domanda


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

circa 11 anni fa | 1 risposta | 0

1

risposta

Carica altro