已回答
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 ...

10 years 前 | 0

已回答
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...

10 years 前 | 0

| 已接受

提问


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

10 years 前 | 3 个回答 | 0

3

个回答

已解决


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

10 years 前

提问


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

10 years 前 | 1 个回答 | 0

1

个回答

已回答
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...

10 years 前 | 0

已回答
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...

10 years 前 | 0

| 已接受

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

已解决


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

10 years 前

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

10 years 前 | 0

已回答
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...

10 years 前 | 0

已回答
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,...

10 years 前 | 0

| 已接受

已回答
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...

10 years 前 | 0

| 已接受

已回答
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...

10 years 前 | 1

已回答
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...

10 years 前 | 0

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

10 years 前 | 2

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

10 years 前 | 2

已回答
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...

10 years 前 | 1

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

10 years 前 | 0

提问


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

10 years 前 | 4 个回答 | 0

4

个回答

已解决


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.

10 years 前

提问


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

10 years 前 | 1 个回答 | 0

1

个回答

提问


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

10 years 前 | 1 个回答 | 0

1

个回答

提问


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

10 years 前 | 1 个回答 | 0

1

个回答

加载更多