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

casi 8 años hace | 0

| aceptada

Respondida
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)); ...

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 2

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 1

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

casi 8 años hace | 0

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

casi 8 años hace | 1

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

casi 8 años hace | 0

Respondida
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,[],...

casi 8 años hace | 1

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 4

| aceptada

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

casi 8 años hace | 0

Respondida
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),[],...

casi 8 años hace | 1

| aceptada

Respondida
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)

casi 8 años hace | 0

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

casi 8 años hace | 3

| aceptada

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

casi 8 años hace | 0

| aceptada

Respondida
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{:...

casi 8 años hace | 2

| aceptada

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

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

Cargar más