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

mehr als 9 Jahre vor | 0

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

mehr als 9 Jahre vor | 0

| akzeptiert

Frage


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

mehr als 9 Jahre vor | 3 Antworten | 0

3

Antworten

Gelöst


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

fast 10 Jahre vor

Frage


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

mehr als 10 Jahre vor | 1 Antwort | 0

1

Antwort

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

| akzeptiert

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 0

| akzeptiert

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

mehr als 10 Jahre vor | 1

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

mehr als 10 Jahre vor | 0

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

mehr als 10 Jahre vor | 2

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

mehr als 10 Jahre vor | 2

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

mehr als 10 Jahre vor | 1

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

mehr als 10 Jahre vor | 0

Frage


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

mehr als 10 Jahre vor | 4 Antworten | 0

4

Antworten

Gelöst


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.

mehr als 10 Jahre vor

Frage


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

mehr als 10 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


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

mehr als 10 Jahre vor | 1 Antwort | 0

1

Antwort

Frage


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

mehr als 10 Jahre vor | 1 Antwort | 0

1

Antwort

Mehr laden