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

casi 8 años hace | 3

| aceptada

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

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 1

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

casi 8 años hace | 1

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

casi 8 años hace | 1

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

casi 8 años hace | 0

Respondida
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(:),...

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 0

Respondida
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

casi 8 años hace | 0

| aceptada

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

casi 8 años hace | 1

| aceptada

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

casi 8 años hace | 0

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

casi 8 años hace | 0

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

casi 8 años hace | 1

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

casi 8 años hace | 0

Cargar más