回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
Creating a Helix Spiral
r = ... gap = ... t = (2*pi/gap)*(0:0.001:10); st = r*sin(t); ct = r*cos(t);

7年弱 前 | 1

| 採用済み

回答済み
Compare values in a matrix and keep the lowest number in each element?
Assuming they are the same size min(A,B)

7年弱 前 | 1

| 採用済み

回答済み
How to fill array of zeros with string
x = cell(5,1); for k =1:length(x) x(k) = {'load'}; end

7年弱 前 | 0

| 採用済み

回答済み
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

7年弱 前 | 1

| 採用済み

回答済み
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...

7年弱 前 | 0

回答済み
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')

7年弱 前 | 0

| 採用済み

回答済み
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,...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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

7年弱 前 | 0

回答済み
unique elliptic curve points
use UNIQUE command

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
How to use transpose in my graph?
Put this after imagesc command set(gca,'Ydir','normal') or imagesc(x,y,flipud(C) )

7年弱 前 | 1

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

質問


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

7年弱 前 | 1 件の回答 | 1

1

回答

回答済み
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...

7年弱 前 | 1

回答済み
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)

7年弱 前 | 0

| 採用済み

回答済み
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))'...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 2

| 採用済み

回答済み
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...

7年弱 前 | 1

| 採用済み

回答済み
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 ...

7年弱 前 | 1

回答済み
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...

7年弱 前 | 0

回答済み
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...

7年弱 前 | 0

| 採用済み

回答済み
Combining sub-matrices diagonally within a for loop
submats = arrayfun(@(n) 2*(1:n)'+(1:n),[3 1 2],'unif',0) matrix = blkdiag(submats{:})

7年弱 前 | 0

| 採用済み

回答済み
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...

7年弱 前 | 1

回答済み
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...

7年弱 前 | 0

さらに読み込む