Réponse apportée
random order of elements in array meeting some conditions
Dynamic programming rpermc() %% save the rest in rpermc.m if needed function r = rpermc() while true r = rpc([], 20:5...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Surface plots inside loop
Assuming your xdata and ydata are sorted. My code doest not make new resampling of x and y, or interpolation, I just stitch them...

presque 7 ans il y a | 0

Réponse apportée
loosing quadrant data using atan2 when finding angle between 3 points (in 3D space) in MATLAB
You diagram looks like 2D and not 3D. In 3D you can turn around and look in opposite direction. The atan2 formula assume you lo...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Creating a Helix Spiral
r = ... gap = ... t = (2*pi/gap)*(0:0.001:10); st = r*sin(t); ct = r*cos(t);

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Compare values in a matrix and keep the lowest number in each element?
Assuming they are the same size min(A,B)

presque 7 ans il y a | 1

| A accepté

Réponse apportée
How to fill array of zeros with string
x = cell(5,1); for k =1:length(x) x(k) = {'load'}; end

presque 7 ans il y a | 0

| A accepté

Réponse apportée
how can i generate random number divided by 0.25 from 0 to 10 for example(0.25,7.75,5.50,6.25 ,........)?
Generate 1000 of such numbers (randi(41,1,1000)-1)/4

presque 7 ans il y a | 1

| A accepté

Réponse apportée
find row index if all column elements are known
If A is your array, for example A=ceil(10*rand(10000,3)) and you want to find [1,2,3] this command find(ismember(A,[1 2 3],'r...

presque 7 ans il y a | 0

Réponse apportée
How can I set the colors in the legend if I show a number of legend elements which is lower thatn the number of plotted functions?
h=bar(rand(10,3)) legend(h(1:3),'1','2','3')

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Euclidean distance of adjacent pairs of matrix
All pairs If you have the right toolbox, take a look at PDIST2 function. If not [m,n] = size(A); D = sqrt(sum((reshape(A, [m,...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
how do I relate two arrays with a reference point ?
y=[1 2 3 5 7]; x= [-2 -1 0 1 2 ] nz = 2; % number of zeros to be inserted y(end+nz,:) = 0; y = y(1:end-nz) x = (0:length(y...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to close the boundary of a surface already generated by filling the holes
You can use imclose (image processing toolbox required) https://fr.mathworks.com/help/images/ref/imclose.html

presque 7 ans il y a | 0

Réponse apportée
unique elliptic curve points
use UNIQUE command

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to generate matrices that satisfies constraints on sum of row elements and sum of column elements?
New code with speficied target row and col sum, using FEX randfixesum and requires optimization toolbox EDIT: new code no longe...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
How to use transpose in my graph?
Put this after imagesc command set(gca,'Ydir','normal') or imagesc(x,y,flipud(C) )

presque 7 ans il y a | 1

| A accepté

Réponse apportée
How to generate all possible (10x10) matrices containing only 0s and 1s, along with other restrictions, for a Graph Theory application.
One simple thing you could do is move outt the while loop all the preparation step that compute variable that does change graph...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to generate all possible (10x10) matrices containing only 0s and 1s, along with other restrictions, for a Graph Theory application.
Here is working code that generate a random adjadcent matrix when allowing 4 nodes of degree 3 6 nodes of degree 6 to be comp...

presque 7 ans il y a | 1

Question


Why INTLINPROG returns non-integer?
Why the solution of intlinprog is not integer? Few of many components returned are 0.5 despite being instructed as integer. loa...

presque 7 ans il y a | 1 réponse | 1

1

réponse

Réponse apportée
How to do discontinuous piecewise linear model fitting?
"Do you have any additional insights or comments on this approach on fitting models?" Well, I actually have problem to fit your...

presque 7 ans il y a | 1

Réponse apportée
How can I expand a array with with even zero intervals in between?
nz = 2; b = a; b(end+nz,:) = 0; b = b(1:end-nz)

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Generating a select set of permutations
m = 17; nnz = 4; p=(nchoosek(1:m,nnz)); q=2*(dec2bin(0:2^nnz-1)-'0')-1; C=repelem(p,size(q,1),1); R=repmat((1:size(C,1))'...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
consecutive combination of numbers from a list
>> (1:19)'+(0:2) % (1:m-n+1)'+(0:n-1) ans = 1 2 3 2 3 4 3 4 5 4 5 6...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Linprogr in Matlab not finding a solution when a solution exists
It looks to me LINPROG is flawed or buggy in your case. I try to remove suspected constraints and change beq so that the equalit...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
Plot feasible region of a high-dimensional linear programming along some dimensions
Something is wrong in my implementation of understanding of your problem, but there is no feasible point found by my code. A=lo...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Plot feasible region of a high-dimensional linear programming along some dimensions
What is your motivation to do that? You clearly underestimate such task, simply because the number of vertices of simplex grow ...

presque 7 ans il y a | 1

Réponse apportée
how to pick up all combination of numbers from multiple vectors
a=[1 2 3], b=[4 5 6 7], c=[8 9 10 11 12] C = {a,b,c}; % put you vectors here n = length(C); [C{:}] = ndgrid(C{:}); C = r...

presque 7 ans il y a | 0

Réponse apportée
What does ~ mean in an assignment when calling a function?
[~, J] = .... mean the first output is ignored by the caller (assigned to a garbage if you like). Even that syntax exists, I o...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Combining sub-matrices diagonally within a for loop
submats = arrayfun(@(n) 2*(1:n)'+(1:n),[3 1 2],'unif',0) matrix = blkdiag(submats{:})

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Why is tic/toc not reporting the correct elapsed time?
I never have problem with tic/toc. I believe it inquires CPU frequency/counter or clock and derive time from it. It's very direc...

presque 7 ans il y a | 1

Réponse apportée
Calculating roll, pitch, and yaw from XYZ coordinates of 3 planar points?
You might use FEX by Matt to derive the translation/rotation (6DOfs), then compute the roll/pitch/yaw from the rotation matrix...

presque 7 ans il y a | 0

Charger plus