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

7 years ago | 2

| accepted

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

7 years ago | 0

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

7 years ago | 1

| accepted

Answered
Using for loops to check elements
for i=1:length(a)-1 interval = a([i i+1]); dosomething(interval); end

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

Answered
Quadprog new "feature"
Can you just switch off by WARNING('off',...) like any other warnings?

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

Answered
How to find inverse of a non square matrix?
unconstrained solution a = y \ x

7 years ago | 1

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

7 years ago | 0

| accepted

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

7 years ago | 0

Answered
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,:)

7 years ago | 1

| accepted

Answered
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))

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

Answered
mxCreateSharedDataCopy no longer supported in R2018a
An alternative solution would be to hack mxArray internal structure /* File "mxInternals_R2018B.h" */ ...

7 years ago | 1

Answered
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 ,:); ...

7 years ago | 0

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

7 years ago | 0

| accepted

Answered
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))

7 years ago | 0

Load more