Answered
How can i speed up this large matrix multiplications?
There is also another way to precompute B*C as explained <https://fr.mathworks.com/matlabcentral/answers/416237-how-can-i-improv...

7 years ago | 0

| accepted

Answered
I have some elliptic curve points as (x y) . How can i extract just y values of all the points ?
p = 123457; a = (0:p-1); y2 = mod(a.^2,p); z = mod(a.^3+537*a+2438,p); [b,i] = ismember(y2,intersect(z,y2)); ...

7 years ago | 1

| accepted

Answered
How to find all possible routes with a given node matrix?
I found actually 13 paths, more than the 10 you have listed: [6 1 23 9 8 7 4 2 5 11 10 13 12 14 19 18 16 17 25 22 21] ...

7 years ago | 2

| accepted

Answered
How can I speed up the following code? I am using MATLAB R2018a. Thanks.
Code blindly: PP = reshape(p,[X*Y,T]); % p == 0? EE = reshape(e,[X*Y X*Y]); MM = reshape(M,[X*Y T]); PP = PP + bet...

7 years ago | 0

| accepted

Answered
How to find area of all possible polygons?
n = 5; % No. of control points array = 1:1:n; p=arrayfun(@(k) num2cell(nchoosek(array,k),2), 3:length(array), 'unif'...

7 years ago | 0

| accepted

Answered
Newton's method for root finding
Quick look, this looks suspiciously a buggy statement xold=xold;

7 years ago | 0

| accepted

Answered
how to get summation of column-2 values by comparing column-1 values in matlab
load('att_total_count.mat') [c1,~,J] = unique(data3(:,1)); s2=accumarray(J,data3(:,2)); [c1,s2] plot(c1,s2...

7 years ago | 0

Answered
How to find all the possible permutations in a given array?
x = [1 ; 2 ; 3 ; 4 ; 8 ] p=arrayfun(@(k) num2cell(nchoosek(x,k),2), 3:length(x), 'unif', 0); p=cat(1,p{:}); p=c...

7 years ago | 0

| accepted

Answered
Replacing for loops for faster computations involving 3D matrix and sampling
What are xSample,... zSample and idx? Not sure you need to translate and filter over and over in the for-loop. It seems awful...

7 years ago | 0

Answered
Updating from 2018a to 2018b
You need to uninstall manually the version that you don't want to keep. Some people like me have many versions installed on t...

7 years ago | 1

Answered
is it possible that answers can be accepted?
I might win 2 points or nothing

7 years ago | 0

Answered
is it possible that answers can be accepted?
Can you accept this one and the previous one?

7 years ago | 1

Answered
is it possible that answers can be accepted?
Can you accept this one and the next one?

7 years ago | 0

Answered
I am trying to plot a 3D figure defined by z>=0:
x = linspace(-2,2,50); y = linspace(-2,2,50); z = linspace(-0.1,2,50); x = reshape(x,[],1,1); y = reshape(y,1,[],...

7 years ago | 1

Answered
Plotting the area defin
almost right, you need to make a & b oriented in 2 different dimensions (here row for a and column for b) a=linspace(0...

7 years ago | 0

Answered
Plotting the area defin
Or perhaps you want this? a=linspace(0,1,100)'; b=linspace(0,1,100)'; rect = [a 0+0*a; 1+0*b b; fli...

7 years ago | 0

Answered
What does 'Mex file (mexw64) cannot find required compilers' mean?
It means you need a C-compiler installed on your computer

7 years ago | 0

Answered
Ensure same random coordinates do not appear twice
You can do by rejection margin = 1.2; n = 1000; xy = []; mxy = 0; while mxy < n m = ceil(margin*n)-mxy; ...

7 years ago | 0

Answered
How to get all the solutions to an underdetermined system of linear equations using lsqnonneg()?
The number of solutions is infinity. Explanation: >> size(a) ans = 5 45 In your case you have ...

7 years ago | 4

| accepted

Answered
Cubic Splines for Interpolation
% fake data x = sort(rand(1,5)) y = rand(size(x)) xmissing = linspace(0,1,1000); % put here coordinates of pts to...

7 years ago | 0

Answered
How to group double matrix based on the first column values and list second values as observations?
X = [1 2.1 1 2.3 2 1.9 3 4.0 1 2.0] [id,~,j]=unique(X(:,1)); val = accumarray(j,X(:,2),[],...

7 years ago | 1

| accepted

Answered
Count number of times value occurs
Assume a and b are row vectors, and one of them is not too big c = sum(a(:)==b,1)

7 years ago | 0

Answered
Count number of times value occurs
Method for large _a_ and _b_ [u,~,j] = unique(b(:)); [b, i] = ismember(a(:),u); c = accumarray(i(b),1,size(u)); c ...

7 years ago | 3

| accepted

Answered
Obtain subscript values of common diagonal rectangle in binary matrix?
% Fake data MM_bin=rand(100)>0.2; check_mat = [0 0 0 0 0 1 1 1 1; 0 0 0 0 1 1 1 1 0; 0...

7 years ago | 0

| accepted

Answered
Matrix showing all combinations of multiple dice roll
dice_size=[2 3 4]; n = length(dice_size); c = arrayfun(@(n) 1:n, flip(dice_size), 'unif', 0); [c{:}] = ndgrid(c{:...

7 years ago | 2

| accepted

Answered
How get row index of first and last appearance each unique cell element
Make the output in the "stable" order: x = ["MUY09KT00" "TW00.00" "MUY09KT00" "TW00.00" "MUY09KT00" "TW00.0...

7 years ago | 1

| accepted

Answered
reduce execution time in matlab
@dpb The comment %#ok<AGROW> tells the author (Kevin Sheppard) is well aware about growing, and he obviously doesn't care. ...

7 years ago | 0

Answered
What is the complexity of ismember function?
"Is there a better function in matlab (with lower complexity) that i can use that assuming the input is sorted" You could do ...

7 years ago | 0

Answered
What is the algorithm used by svds function?
svds is a MATFILE and it calls different methods depending on your inputs. You might step over and see if _matlab.internal.math....

7 years ago | 0

| accepted

Answered
assimble small victors into bigger one using for loop
a1= [1; -1]; a2= [1 ;-1]; a = {a1 a2}; F = zeros(length(a)+1,1); for i=1:2 F(i+[0,1]) = F(i+[0,1]) + a{i}...

7 years ago | 0

Load more