Community Profile

photo

Grace


Active since 2014

Statistics

  • First Review
  • Thankful Level 3

View badges

Content Feed

View by

Question


How to eliminate array which contain zero, negative values, repeated values, etc constraint?
Hi, I have n=6 and for example I have several set of points ( with 6 elements), a=[1 5 1 6 2 6]; b=[2 5 1 6 2 5]; c=[3 5...

9 years ago | 1 answer | 0

1

answer

Question


How to get a set of numbers with the first and the last absolute difference are the same and etc.
Hi I have n=5, and I will get a set of points for example a=[ 3 1 4 2 5]; which the elements are from 1 to 5 without rep...

9 years ago | 3 answers | 0

3

answers

Question


How to find first ten prime numbers that are greater than 4?
Hi, How am I going to make an array that consists of first 10 prime numbers that are greater than 4 as follows? a=[5 7 11...

9 years ago | 1 answer | 0

1

answer

Question


How to eliminate the elements in an array from another array?
Hi I have two arrays: a=[ 1 2 3 5 6 7 8 9 100]; b=[1 2 3]; I want to eliminate the elements in b from a and gives me:...

9 years ago | 2 answers | 0

2

answers

Question


How to find prime numbers?
Hi, primes(25) gives me the prime numbers that are less or equal to 25. What if i want to find primes numbers that are ...

9 years ago | 1 answer | 0

1

answer

Question


How to get a geometric sequence?
Hi, I have tao=1000; v=0.9; T1=0.01; I want to have a geometric sequence T, where T1=T2=T3...=T1000 ( since tao=1000...

9 years ago | 2 answers | 0

2

answers

Question


How to randomly exchange 2 entries in a column?
Hi, I have a=[ 1 2; 3 4; 2 1; 4 5; 5 3] I want to choose randomly any 2 entries from a colum...

9 years ago | 1 answer | 0

1

answer

Question


How to detect which rows are left in the matrix when the unique function is used to eliminate the repeated rows?
Hi, I have a= 1 1 1 2 1 2 1 2 1 1 1 2 b=unique(a,'rows'); >>b= ...

9 years ago | 1 answer | 0

1

answer

Question


How to obtain the absolute difference between elements in a row?
Hi I have a= 4 3 2 1 4 3 1 2 4 2 3 1 I want to know the absolute differe...

9 years ago | 1 answer | 0

1

answer

Question


How to detect repeated values between rows?
Hi I have a= 1 2 3 1 2 3 2 3 3 2 1 1 I want to detect whethe...

9 years ago | 1 answer | 0

1

answer

Question


How to eliminate the rows with replication?
Hi, I have a=[1 1 2], I want to know all the possible arrangements of a, then I do the permutation which gives me: >...

9 years ago | 1 answer | 0

1

answer

Question


How to minimize a complicated function?
Hi, I have a function function ces=mat(UT) U=UT; [n,s]=size(U); X=(2*U-1)/(2*n); cs1=zeros(n,1); for k=1:n CSP=1; ...

9 years ago | 1 answer | 0

1

answer

Question


How to get all possible arrangements for n=10 and more
Hi, I wish to get all the possible arrangements for n=10 and more,I used permutation and the output shows me: >> perms(1:10)...

10 years ago | 1 answer | 0

1

answer

Question


How to use for loop to get the minimum number in an array
For simplicity, I have A=[ 11 7 10 9 6 4 3] and B=8 I want to have a for loop to compare each of the elements in ...

10 years ago | 2 answers | 0

2

answers

Question


Permute/Rearrange/Shuffle the elements of a matrix
Hi, I have A=[2 3 4 1 1 4 3 2 5 5]; I want have the all possible arrangements, w...

10 years ago | 1 answer | 0

1

answer

Question


How to show output in multidimensional array?
I have an output shows me: udd = [4x2 double] [4x2 double] where udd{1}= 1 2 2 4 ...

10 years ago | 1 answer | 0

1

answer

Question


how to substitute a row vector to a column of a matrix
Hi, I have a=[1 2 3 4; 5 6 7 8; 9 10 3 4] b=[4 5 7] I want to substitute b to my second column of a to be...

10 years ago | 1 answer | 0

1

answer

Question


Index exceeds matrix dimensions, error problem
function cut=UDcutcut(n,s,p) initial=[ 1 3;2 6; 3 2; 4 5; 5 1; 6 4; 7 7]; [r s]=size(initial); new_initial=cell(s,1); UT...

10 years ago | 3 answers | 0

3

answers

Question


How to combine 2 for loops
Hi, I have id = [ 1 3; 2 6; 3 2; 4 5; 5 1; 6 4; 7 7]; I will get two new_ids by sorting its column, for col=1:c ...

10 years ago | 1 answer | 0

1

answer

Question


relabel the elements in each column according to the magnitude of these elements in an array
Hi, I have a=[4 5; 5 1; 6 4; 7 7] I want to relabel the elements in each column according to the magnit...

10 years ago | 1 answer | 0

1

answer

Question


complicated for loop with 2 requirements or constraints
Hi,I have a=[1 2; 3 4; 5 6;7 8]; Suppose I want my result to have two sets of number, which set 1 is [1 2; 3 4; 5 6] and ...

10 years ago | 2 answers | 0

2

answers

Question


store result for loop for 2D array
Hi, I have a=[1 2; 3 4; 5 6]; for m=1:4 if m<=2 b=a([2 3],:) else c=a([1 2],:) ...

10 years ago | 1 answer | 0

1

answer

Question


How to name each of the elements in an array?
Hi, I have id=[ 1 3 2; 2 6 4; 3 2 6; 4 5 1; 5 1 3; 6 4 5; 7 7 7]; I want to give a name to each of the elements in id, c_kj...

10 years ago | 1 answer | 0

1

answer

Question


How to reorder the rows by sorting the elements of column in ascending order?
Hi everyone, I have id=[ 1 3 2; 2 6 4; 3 2 6; 4 5 1; 5 1 3; 6 4 5; 7 7 7] j=1:3 I want to reorder the rows of id by sor...

10 years ago | 2 answers | 0

2

answers

Question


Multiplication of elements in array
Hi everyone, I have b=[1 1 1; 1 2 4; 1 3 9; 1 4 16] and k=1:5, I want to have 4 different set of numbers. There are total 4 r...

10 years ago | 2 answers | 0

2

answers

Question


How to show my output from matrix?
Hi everyone, i have c= 1 1 1; 2 4 8; 3 9 27; 4 16 64 I extracted each row by c(1,:), c(2,:), c(3,:) and c(4,:). I wa...

10 years ago | 1 answer | 0

1

answer

Question


how to multiply each of the array with another set of array
Hi everyone, suppose i have a=1,2,3,4 and j=1,2,3 I want to get 1^1, 1^2, 1^3, 2^1, 2^2, 2^3, 3^1, 3^2, 3^3, 4^1, 4^2 and 4^3....

10 years ago | 1 answer | 0

1

answer