Question

Gaussian distribution for 2D points

I want to generate well distributed 100 points using gaussian distribution in a 100x100 region having seperate variances in x-a...

11 månader ago | 1 answer | 0

Question

Plot to avoid certain regions in 2D plot

I have to plot some random points in 500 x 500 area by avoiding certain area (poly0 and poly1 in the example below) in the 2D-pl...

nästan 2 år ago | 2 answers | 0

Question

area of intersection between a circle and polygon

x = 0;y = 0; r = 0.5; th = 0:pi/50:2*pi; xunit = r * cos(th) + x; yunit = r * sin(th) + y; h = plot(xunit, yunit...

nästan 2 år ago | 1 answer | 0

Question

Sort rows based on number of 1's in each row.

I have a matrix A = [1 1 0 1; 1 0 0 0 ; 1 0 1 0 ; 1 1 1 1]; I count the number of 1's in each row and I get count=[3 1 2 4]. I w...

mer än 2 år ago | 1 answer | 0

Question

How to check if a point lies in the sector of a circle?

I have a sector defined by the following code. x0=12; y0=13; theta =30; r=3 a1 = 2*pi*rand; % A random direc...

nästan 3 år ago | 1 answer | 0

Question

intersection of multiple arrays

I have multiple 1D arrays with integers. Eg. A=[1,2,3,4] B=[1,4,5,6,7] C=[1,5,8,9,10,11]. Here 1 is repeated in all the arrays a...

nästan 3 år ago | 3 answers | 0

Question

random number generation to add and subtract

I want to create an array of 4 single digit numbers in the range [-9,9] without 0. Addition of these 4 numbers should result in ...

nästan 3 år ago | 3 answers | 0

Question

writing multiple 2D matrices in 1 excel file

I have multiple variables containing 2D data that I want to write in either xls or txt file. Suppose in each iteration I get ...

nästan 3 år ago | 2 answers | 0

Question

plots values at specfic indices from 1D array

I have an array of 500 values. I want to plot value at every 50th index (i.e. 1, 51, 101, 151, 201, 251, 301, 351, 401, 451 and ...

mer än 3 år ago | 1 answer | 0

Question

Writing results in excel from matlab

I need to write a string value in an excel cell, followed by array values of A and B (each value in a different cell) like in th...

mer än 3 år ago | 1 answer | 0

Question

grouping string values in matlab

I have 3 columns. 1st column is a numeric (1,2,3....) denoting person number. 2nd column states the day of week(sun-sat). 3rd co...

mer än 3 år ago | 2 answers | 0

Question

customizing point names in matlab

Is there a way to rename the point names in matlab plots? I know the following code will label the points from 1 to k. for ...

mer än 3 år ago | 2 answers | 0

Question

How to populate a cell array?

I want to create an array with 10 rows and each row should contain a [5x2] matrix. I also want to know (a)inserting data...

mer än 3 år ago | 1 answer | 0

Question

identify duplicate rows in a matrix

I have a matrix A = [1 2 3; 3 4 5; 1 2 3]; I want to identify the duplicate row i.e. 3rd row and replace the values in tha...

nästan 4 år ago | 2 answers | 0

Question

Finding second smallest element in a row.

I have a row X = [441 137 594 507 417 581 312 362 263 151 472 512 129 70 298 255 442 574 289 157 0]; I want to find the s...

nästan 4 år ago | 2 answers | 0

Question

points lying in the intersection of 2 circles

Suppose i have 2 points (x1, y1) and (x2,y2). I draw circle with radius 'r'. I want to find "all" the points which lie in the in...

nästan 4 år ago | 1 answer | 0

Question

finding elements in a matrix`

I have a a matrix A= [1 3 10; 1 8 10; 2 4 9] and an array x = [2 9]. i want to check if x is present in a ...

nästan 4 år ago | 2 answers | 0

Question

remove duplicate rows from a matrix

I have a matrix of the form A=[317.0000 282.0000 310.0000 259.0000 257.0000 305.0000 294.6667 282.0000 317.00...

nästan 4 år ago | 2 answers | 0

Question

Difference between the arrays

I have 2 arrays A= [1 2 3 4] and B = [2 3 4 5] representing paths in a graph. I want to find difference between the arrays. A-B ...

nästan 4 år ago | 1 answer | 0