Réponse apportée
how quick/efficient is linprog depending on the lenght of the intervall on which it looks for a solution?
Nope, usually the searching time depends mainly on the topology structure of the boundary of the feasible set: how many vertices...

presque 8 ans il y a | 2

| A accepté

Réponse apportée
Simple question about for-loop error: Unable to perform assignment because the left and right sides have a different number of elements.
Not because the course use the notation x_n for x at iteration #n, that you should code "x(n)", which in MATLAB language means t...

presque 8 ans il y a | 0

Réponse apportée
Multiplication of two matrices of different rank
RESHAPE is a cleanest and fastest way to do tensor-extension of mtimes on multi-dimension arrays. szA = size(A); szB = s...

presque 8 ans il y a | 1

| A accepté

Réponse apportée
I have to switch the max and min elements in a vector and assume vec = ceil(rand(1, 10)*100) is a vector containing 10 random generated integers. The script i have to provide will swap the maximum and the minimum element in the vector.
Solution for the problem of "swapping" ties min-values with ties max-values minA = min(A); maxA = max(A); ismax = A==...

presque 8 ans il y a | 1

Réponse apportée
Using for loops to check elements
for i=1:length(a)-1 interval = a([i i+1]); dosomething(interval); end

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to group numbers of a vector
Can you try this one, I put the flag so that you can select if the common point that goes to left or right group, if you have ot...

presque 8 ans il y a | 0

Réponse apportée
Best way to find all possible linear combinations of n rows from large dataset that meets a target for each column
Your problem can be formulated as finding (all) feasible solutions of a linear constraints. A*c >= target c >= 0 ...

presque 8 ans il y a | 1

Réponse apportée
elimination of consecutive regions
You could use Huffman encoding (there might be some on the FEX), but the idea is similar to this direct code: N = 2 A = ...

presque 8 ans il y a | 1

Réponse apportée
Arrays intersection with repetition
% random test data output_min = ceil(30*rand(1,20)) output_max = ceil(30*rand(1,20)) % find the indexes of the in...

presque 8 ans il y a | 0

Réponse apportée
How to group numbers of a vector
OK, try this: b = [true, false, diff(V,2)~=0]; b = b & [true, ~b(1:end-1)]; b = find(b); lgt = [b(2:end)...

presque 8 ans il y a | 0

Réponse apportée
How to find three largest absolute value correlations in a table
maxk(p07,3) if you have MATLAB R2017b or later

presque 8 ans il y a | 0

Réponse apportée
random generation of 2 variables
Here is a solution that does not require any quantification, but need this <https://fr.mathworks.com/matlabcentral/fileexchange/...

presque 8 ans il y a | 0

Réponse apportée
Quadprog new "feature"
It might be possible that with big matrix, degenerated semi-convex problem is detected as non-convex due to the numerical accura...

presque 8 ans il y a | 0

Réponse apportée
Error (error in line 42) in using matlab execution (guide compiled) file.
Shooting in the dark : Delete the line #42 (that the best I can do to help you).

presque 8 ans il y a | 0

Réponse apportée
Quadprog new "feature"
Can you just switch off by WARNING('off',...) like any other warnings?

presque 8 ans il y a | 0

Réponse apportée
can anyone suggest me a command that talks about how matlab performed an arithmetic operation (its steps to give us the final result) ?
_f(3)^f(4) would have to be done first_ That's the case, the *power* is the first to be performed (among operators), but it's...

presque 8 ans il y a | 0

Réponse apportée
can anyone suggest me a command that talks about how matlab performed an arithmetic operation (its steps to give us the final result) ?
Here is an idea, replace the number of your expression by functions (that return a scalar) and print out the order % (1/2+0...

presque 8 ans il y a | 0

Réponse apportée
How to find inverse of a non square matrix?
unconstrained solution a = y \ x

presque 8 ans il y a | 1

Réponse apportée
Passing const mxArray *prhs[i] to a function gives wrong values.
You make a terrible mistake of pointer manipulation: passing Data->XR (a double pointer) as input argument will nener be updated...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to apply a function to a column of the result of matrix multiplication to get reduced size of resulting matrix?
It all depends what we do in the loop, typical in this example the for loop will call matrix * smaller_matrix which is...

presque 8 ans il y a | 0

Réponse apportée
Find unique rows (including rows with reverse x,y) in matrix of x,y coordinates
Try [~,i] = unique(sort(data(:,1:2),2),'rows') data(i,:)

presque 8 ans il y a | 1

| A accepté

Réponse apportée
How to apply a function to a column of the result of matrix multiplication to get reduced size of resulting matrix?
This is no more than a disguised for-loop result = arrayfun(@(col) min(a*b(:,col)), 1:size(b,2))

presque 8 ans il y a | 0

Réponse apportée
matlab Compiler using mex file
The packaging is put on CTF file or directly in EXE file then unpack the first time you run at the location where it think it's ...

presque 8 ans il y a | 0

Réponse apportée
How to write a better "if condition" to eliminate some unwanted matrices?
Sahin: there is one thing obvious I didn't see until now, but the each column of the product TM * inField depends independ...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
How to solve x^4-p*x+q.solve for x considering p and q as constants
roots([1,0,0,-p,q])

presque 8 ans il y a | 0

Réponse apportée
Compare pair of elements in different arrays
Q1 = [3 2 6 8 10 2] Q2 = [1 7 12 4 6 8 3 2] P1=[Q1(1:end-1),;Q1(2:end)]' P2=[Q2(1:end-1),;Q2(2:end)]' interse...

presque 8 ans il y a | 0

Réponse apportée
mxCreateSharedDataCopy no longer supported in R2018a
An alternative solution would be to hack mxArray internal structure /* File "mxInternals_R2018B.h" */ ...

presque 8 ans il y a | 1

Réponse apportée
Finding the first element of a matrix that satisfy a condition in a frequently manner
Your loop is equivalent to condmeet = y_coordinate(:,2)<31.35 & y_coordinate(:,4)<0; TR = y_coordinate(condmeet ,:); ...

presque 8 ans il y a | 0

Réponse apportée
Converting a numeric array into a string array with their corresponding values
cl = {'BLACK' 'BROWN' 'RED' 'ORANGE' 'YELLOW' 'GREEN' 'BLUE' 'VIOLET' 'GREY' 'WHITE'}; %input = [2 7 0 0 0]; input=...

presque 8 ans il y a | 0

| A accepté

Réponse apportée
solving for unknown matrix element as function of an undetermined independent variable
If there is an solution it would be: r = @(E) (-a21(E)./a22(E)) t = @(E) (a11(E) - a12(E).*a21(E)./a22(E))

presque 8 ans il y a | 0

Charger plus