Answered
How to modify an array's elements using another element?
Fix code: function bonusScores = CombineScores(numberScores, userScores) for i = 1:numberScores-1 userScores(i) =...

7 years ago | 3

| accepted

Answered
Sampling some elements without replacement out of big population, based on a probability distribution
*Your question is mathematically inconsistent*. Take a very simple example, a population of 2: [1,2], and you want to generate 1...

7 years ago | 1

| accepted

Answered
add non zeros in array to my probability formular
ep = 1 - prod(1-a,2)

7 years ago | 1

| accepted

Answered
how to store data in cell array
faceData = cell(40,5); % or cell(5,40) for i=1:40 for j=1:5 % ... read v w = uint8(v); faceDat...

7 years ago | 0

| accepted

Answered
Why 'for loop' is very slow even working on server
As I mention in <https://fr.mathworks.com/matlabcentral/answers/424724-why-is-the-function-isinterior-filling-up-memory another ...

7 years ago | 0

Answered
I cannot figure out how to solve this. I NEED HELP!
Declare some useful anonymous functions (only the last one will be use) n60 = @(t) [t(1)+floor(t(2)/60), mod(t(2),60)]; ...

7 years ago | 0

Answered
accessing all elements along the diagonals and rows (simple backprojection algorithm for image reconstruction)
OK, here is the conv method as proposed by IA and started by Guillaume, it works for rectangular input array as well. Some convo...

7 years ago | 0

Answered
How do I find an efficient way to create a matrix from an array
A = 1:100; B = (0:100)' + A

7 years ago | 0

Answered
Why is the function isinterior filling up memory?
Alternative? Easy just go back to INPOLYGON or even better: my <https://fr.mathworks.com/matlabcentral/fileexchange/27840-2d-pol...

7 years ago | 0

| accepted

Answered
find element in array
Not sure how you get the result, but here is an attempt Data E=[1 2;1 5;2 3;2 4;2 5;3 4;4 5;4 7;4 9;5 6;6 11;6 12;6 13; ...

7 years ago | 0

| accepted

Answered
find a same element inside a cell
C = {[1,2,5],[2,3,4],[1,2,4,5],[4,7,9],... [1,2,4,5,6,9,10,11],[6,12,13],[1,2,4,5,6,9,13,14]}; % uncomment this line ...

7 years ago | 0

Answered
Convert Adjacency list of graph into Adjacency matrix
use SPARSE or ACCUMARRAY

7 years ago | 0

Answered
3D Best Fit Line
% Fake n-points in R3, n=4 in your case n = 10; a = randn(3,1); b = randn(3,1); t = rand(1,10); xyz = a + b.*...

7 years ago | 0

| accepted

Answered
Splitting a matrix into group based into the first column and select the maximum value from the second column for each interval
AB = [... 0.468490416082415 -68.0623566640544 0.861091227948802 -62.0460361812610 0.920662009016715 -52.2025156248263...

7 years ago | 0

| accepted

Answered
Replacing For loop with Conv2 In edge detection to make it run faster
_"I'm supposed to use im2col in the code and the whole purpose is to avoid a loop and make it run faster. And I'm not allowed to...

7 years ago | 0

Answered
Interpolating function with monotonic decresing first derivative
You can use PCHIP, either in the toolbox or as option of INTERP1 for shape-preserving interpolation. For fitting you might ta...

7 years ago | 0

| accepted

Answered
How to obtain all the solutions of quadratic equations with multiple variables?
I have impression the 4 equations are not independent, and that might confuse MATLAB. For any 2x2 rotation matrix R = [...

7 years ago | 0

| accepted

Answered
FiltFilt function initial and final conditions
Now a rigorous approach of zero-phase FIR on circular data. One need to build a circular matrix from the coefficients A and B, t...

7 years ago | 1

Answered
Repeat values in a vector
Another method: [~,loc] = histc(a2,a1); b2 = b1(loc) yet another one b2 = b1(interp1(a1,1:length(a1),a2,'previou...

7 years ago | 1

Answered
FiltFilt function initial and final conditions
Here is a demo of using filtfilt on periodic data * The first method use filtfilt on one period * The second method stitches...

7 years ago | 1

Answered
Counting up starting from first row of zeros in a matrix, then 1's.
These methods perform just like the subject suggests: counting (rather than sorting) *Method 3:* a=m'; z=a==0; nz ...

7 years ago | 0

Answered
Correspondance matrix for matching values in two vectors
That gives the second form of your expected result, but assuming elements are 1,2,..., n n = 3; c = accumarray([a(:),...

7 years ago | 1

| accepted

Answered
How to apply elliptic curve point multiplication using matlab code or command ?
Take a step back and see what tools you have under the hand. If you want to multiply the point P in EC by a integer number n,...

7 years ago | 0

Answered
why the output of this calculation over 300 is wrong?
100<x<=300 Is not what you think, replace it with 100<x && x<=300

7 years ago | 0

| accepted

Answered
How do I avoid errors due to round-off in Matlab?
t=linspace(0,tend,Nt);

7 years ago | 1

| accepted

Answered
Creating a new string matrix
I will pad appropriate number of ascii-0 characters to the tail of the shorter strings to make them a matrix. >> char({'abc...

7 years ago | 0

Answered
Copy the curve in the Axes of a Figure to the Axes of a GUI
% Fake plot axesrc = axes('Parent',figure(1)); plot(axesrc,sin(linspace(0,4*pi))); axedest = axes('Parent',figure...

7 years ago | 0

Answered
Finding lower convex hull in 3D
You can select the lower part by calculate the z-component of the normal [X,Y,Z] = sphere(50); XYZ = [X(:) Y(:) Z(:)]; ...

7 years ago | 1

Answered
frequency of a range of data from a matrix
use histcounts2

7 years ago | 0

Load more