Answered
determine if one shape is fully enclosed inside another shape
For p and q two polyshapes: pmq=subtract(p,q); qmp=subtract(q,p); include = pmq.NumRegions==0 || qmp.NumRegions==0

7 years ago | 0

Answered
conv a matrix multiple times
a1 = [1 1 0; 1 0 1]; % rand(2,3); p = 5; % power [m,n] = size(a1); %% Method 1, straighforward double for-loops ap...

7 years ago | 0

| accepted

Answered
How to get permutation of two halves of given numbers range 1 to n separately and then concatenate.
>> n=10 n = 10 >> [randperm(n/2), n/2+randperm(n/2)] ans = 5 3 4 2 1 7 9 10 ...

7 years ago | 1

| accepted

Answered
How to generate random projection matrices?
n = 5 r = 3; % rank, dimension of the projection subspace [Q,~] = qr(randn(n)); Q = Q(:,1:r); P = Q*Q' % random projection...

7 years ago | 1

Answered
How to find the index of top k max values in the matrix
>> A=[ 5 40 10 9 2 1 8 12 33 23] A = 5 40 10 9 2 1 8 12 33 23 >> [~,B]=maxk(A,3) ...

7 years ago | 2

| accepted

Answered
How does the "boundary" function decide which points to include in its calculation?
You can look at tthe code to see what it does edit boundary.m The relevant part is Acrit = shp.criticalAlpha('one-region'); ...

7 years ago | 1

Answered
Curve Fitting, Periodic Function
You might be interested in my free knot spline tool that can handle periodic function.

7 years ago | 0

Answered
computing Variance between vectors
No you are not right, the variance computes the square of the "dispersion" of the random variable. In case of random vector vari...

7 years ago | 1

Answered
64 bit binary number representation in matlab without rounding off
Assuming you have your binary in string of length 64 such as b=repmat('0',1,64); b([1 end])='1', You can convert to uint64 in...

7 years ago | 1

Answered
how to replace the elements row by rows instead of column by column in matrix
f = @(A)cumsum(A==3,2)>0; A = A + f(A).*fliplr(f(fliplr(A)))

7 years ago | 2

Answered
Find first non-NaN in each column of array & combine into one vector
X = [2 NaN NaN NaN; 4 6 NaN NaN; NaN NaN NaN NaN; 5 4 7 8 ] [m,n] = size(X); [I,J] = ndgr...

7 years ago | 1

| accepted

Answered
How to solve a special linear equation Ax=b? A is a row vector.
Code for p = Inf and noise_threshold = 0.01; A = [0.103+0.201i 0.196+0.294i 0.401+0.499i 0.602+6.993i 0.803+0.892i] b = 0.5+0....

7 years ago | 0

Answered
Finding unique set from large dataset
x = ["abc", "bcd", "ded"] % no need using curly bracket for strings string(unique(cat(2,x{:}))')'

7 years ago | 0

Answered
Full change of array?
You make a mixing array/scalar in your code. Change count(count+1) = count + 1; to count = count + 1;

7 years ago | 0

| accepted

Answered
Find equal rows between cell array and matrix into for loop
Try this: A=[-0.11 7.17 3.66 -0.09 3.45 1.55 -0.21 2.17 9.87 -0.14 4.88 6.66] B{1,1} = [-0.09 3.45 1.55] B{1,2...

7 years ago | 0

| accepted

Answered
How to save a 3D surface plot in 2D view in vector image format?
Update: Starting in R2020a you can use the exportgraphics function to export to .eps. exportgraphics(gcf,'2D.eps'); (Origina...

7 years ago | 3

| accepted

Answered
How to plot a struct with 2 fields in Matlab
Try this x=reshape([T(:).x],size(T)); y=reshape([T(:).y],size(T)); plot(x(:,[1:end 1])',y(:,[1:end 1])')

7 years ago | 0

| accepted

Answered
Problem with data indexing in nested structure
n = length(Z.hours); % 3 sg=zeros(n,2); for i=1:n b = strcmp({Z.hours(i).AA(:).source},'sg'); sg(i,:) = [i,Z.hours(i...

7 years ago | 0

| accepted

Answered
How to unload C++ interface (of shared library)
Not sure if it's applicable for C++ but have you checked doc unloadlibrary

7 years ago | 0

Answered
Check points inside n number of triangle in a square
see pointLocation method of Triangulation class

7 years ago | 0

| accepted

Answered
Mix-integer optimization problem using GA
Take x1 fix allowed value, e.g. 32, optimize wrt (x2,...), repeat 4 times pick the solutions (among 4) with smallest score value...

7 years ago | 0

Answered
I want to double all the points on the elliptic curves in matlab
See this post there a an algo to demonstrate doubling and adding points in EC. Adapt for your case % EL parameters a = 0; b ...

7 years ago | 2

| accepted

Answered
How can I get the index numbers of cells that form a specific string?
s='a.b.c.d.e' str=[{'a.b.c.d'};{'b.c.d.e'};{'a'};{'b'};{'c'};{'d'};{'e'}] c = idexing(str, s); c{:} str=[{'a.b'};{'b.c'}...

7 years ago | 1

Answered
Assign Value to Multiply Indexed Range
You might store in a table, which by design put the two variables/row dimensions to the same level; so you can index them either...

7 years ago | 0

| accepted

Answered
How to get the vertex points of all grid points within a cube?
[x,y,z]=ndgrid(0:5); scatter3(x(:),y(:),z(:),'r')

7 years ago | 1

Answered
Finding the Probability of a Sequence of Numbers
N = histcounts2(A(1:end-1),A(2:end),1:121,1:121); p = N / sum(N(:))

7 years ago | 0

Answered
How to speedup assignment of indexed large matrix?
In general on a computer there is a huge different between accessing contiguous memory block (fast, the later code) and non cont...

7 years ago | 1

| accepted

Answered
How can I create a matrix with combination of some other matrix elemenst dynamicaly in a loop
V = {[1 2 3] [4 5] [6 7 8] [9 10]}; M = zeros(1,0); n = cell(0); for k=1:length(V) Vk = V{k}; % replace by your dynami...

7 years ago | 0

| accepted

Answered
How to extract only numerical values from cell into new column array?
s={"chb12_06.edf" "1665 seconds" "1726 seconds" "3415 seconds" "3447 seconds" "chb12_08.edf" "1426 seconds" "1439 seconds" "1591...

7 years ago | 0

| accepted

Answered
How do I find the centre of gravity for an irregular shape?
You can get the coordinates of the centroid if you have a boundary coordinates of a polygonal region: [xc,yc] = polygoncentroid...

7 years ago | 0

| accepted

Load more