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

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

Pregunta


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

más de 11 años hace | 3 respuestas | 0

3

respuestas

Resuelto


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

casi 12 años hace

Pregunta


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

alrededor de 12 años hace | 1 respuesta | 0

1

respuesta

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

alrededor de 12 años hace | 0

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

más de 12 años hace | 0

| aceptada

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

Resuelto


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

más de 12 años hace

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

más de 12 años hace | 0

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

más de 12 años hace | 0

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 0

| aceptada

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

más de 12 años hace | 1

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

más de 12 años hace | 0

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

más de 12 años hace | 2

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

más de 12 años hace | 2

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

más de 12 años hace | 1

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

más de 12 años hace | 0

Pregunta


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

más de 12 años hace | 4 respuestas | 0

4

respuestas

Resuelto


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.

más de 12 años hace

Pregunta


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

más de 12 años hace | 1 respuesta | 0

1

respuesta

Pregunta


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

más de 12 años hace | 1 respuesta | 0

1

respuesta

Pregunta


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

más de 12 años hace | 1 respuesta | 0

1

respuesta

Cargar más