Answered
How to match pair of two elements of a matrix with the pair of two elements of another matrix?
A= [1 3; 5 9; 7 6; 10 8] B = [10 8; 7 6; 70 16; 1 3; 12 34; 5 9; 20 45; 10 8] [tf,loc] = ismember(B,A,'rows'); rowindexInA = ...

20 days ago | 0

| accepted

Answered
extract control points of curve with spline
Calm down, if you have 1D data, this FEX function provides to compule the spline with reduced knots to approximate the data. Th...

21 days ago | 0

Answered
Parfor loops indexing into table rows
This works, but I'm not sure is what you want. IMO table is not well-suited data structure to do calculation. Simple raw numeri...

21 days ago | 0

Answered
Why MATLAB coder is crashing while generating trial code with an assertion failed message.
IMO the assertion fault is not the cause but an indicator that you passed the data that are not of the size/class of what the co...

21 days ago | 1

Answered
How to reshape the three dimensional array in 2D matrix?
A = reshape(pagetranspose(val),[],size(val,3))

22 days ago | 1

| accepted

Answered
Decimal and very small values returning zeros
Is is more subtle than I though. You should not use 'ArrayValued'==true to evaluate a series of integral. The use case is to in...

22 days ago | 0

| accepted

Answered
Matlab hidden optimization at the fifth execution
I don't think so. I believe it is related to JIT optimization Executio Engine (EE), some code are not "compiled" at the first fe...

22 days ago | 0

| accepted

Answered
Extract Source Code from Compiled App
"Is it possible to extract or reconstruct the Source Code from a compiled app?" The source code is obfuscated, only TMW and co...

22 days ago | 1

Answered
How do I display "Busy" like that in MATLAB when simulation is running in GUI?
Create a static text somewhere i the GUI and set the string to "busy" before runing simumation tjen "done" once finished. You c...

22 days ago | 0

| accepted

Question


What algorithm pagemldivide uses?
The question starts here from Paul remark that pagemldivide does not return the same numerical solution than backslash "\" appli...

23 days ago | 0 answers | 3

0

answers

Answered
`svd` sometimes blows up - how to fix it?
The thread subject is missleading, SVD does NOT blow up, what blowed up is PINV and it's normal given : >> cond(test_matrix) ...

23 days ago | 1

Answered
Distance between two points on the sphere.
Another formula of angle betwen two (3 x 1) vectors x and y that is also quite accurate is W. Kahan pointed by Jan here % test...

24 days ago | 0

Answered
Error in svd in r2018a
As Walter has pointed out, the workwaround given by TMW might be still flawed because it ignores the scale of A. A better solut...

24 days ago | 0

| accepted

Answered
[ ] or ( ) in constructing array
The only danger is that unexpected results when someone is careless about indentation and spacing a = 1 : 5 +2 b = [1 : 5 +2] ...

25 days ago | 2

Answered
How to fix infinity limit in the integral equation
Use integral function rather trapz % INITIAL CONDITIONS dtemp=1; finaltemp=1050; dt=(dtemp*60/3); H2O=0.023; CO2=0.00555; fp...

25 days ago | 1

| accepted

Answered
How do I reduce the running time when I call thousands of 'intlinprog' ?
You can try to call multiple problems at once by Concatenate f, intcon, b, beq, lb, yb, x0, Make matrices A, Aeq block diagon...

26 days ago | 0

Answered
How to find column where 0 turns to 1 for each row
load('egcolumnsep.mat'); c1 = find(strcmp(DATAb1.Properties.VariableNames,'Bins_1')); % == 10 % Extract relevant data A = t...

26 days ago | 1

| accepted

Answered
Looking for where line intersects on itself
If you interpolate your data by line segments it cross it selft at least 135 times data = readtable('data.csv'); xy=table2arr...

26 days ago | 0

| accepted

Answered
Should I use EIG or SVD to compute the eigenvalues of a symmetric matrix?
I always use EIG on SDP matrix, for the "same" reason that I use A\b preferable to (A'*A) \ (A'*b) to solve least square s...

27 days ago | 0

Answered
multiplication of matrix with long data
% Test data N = 4; Phi = 2*pi*rand(1,N); Theta = 2*pi*rand(1,N); Psi = 2*pi*rand(1,N); X = rand(1,N); Y ...

27 days ago | 1

| accepted

Answered
set unique values in matrix for each column new to 0
Another solution without assum^tion of M is sorted by column M = randi(4,10,3) [m,n]=size(M); [S,i] = sort(M); M(i+(0:n-1)...

27 days ago | 0

Answered
set unique values in matrix for each column new to 0
This works for repeated elements that are in any order in the columns M = randi(4,10,3) [m,n]=size(M); IJ = cell(n,1); v =...

28 days ago | 0

Answered
set unique values in matrix for each column new to 0
It looks like your repeated elemenst are adjacent M = [0 0 0 ; 0 0 1; 1 0 2 ; 2 1 3 ; 2 2 4 ; 2 2 4] M.*(diff([nan(size(M(1,:)...

28 days ago | 0

Answered
How to determine eigenvalues and eigenvectors?
A=[3,9;3,5] B=[2,0;0,8] [V lambda] = eig(A,B,'vector') % here is the first eigen vector with lambda(1) the corresponfing ...

28 days ago | 0

| accepted

Answered
How can I repeat a 2-D array to create a 3-D array?
A =[1 2 3;4 5 6]; B = repmat(reshape(A, [1 size(A)]),[5 1 1])

28 days ago | 0

| accepted

Answered
R2022a Compatibilty with W10 1809 LTSC
I run MATLAB R2020a on Windows 8 without any issue.

29 days ago | 0

Answered
Using regular expressions to recognize pattern based on multiple lines
Two consecutive lines is a string separate by one newline character: s = sprintf('G2 yyyy \nG0 blabla \nG1 xxx') regexp(s,'G0....

1 month ago | 0

Answered
Perform mldivide between 3x3 matrix M and every RGB pixel in a image in GPU
B = reshape(reshape(I,[],3)*inv(M.'),size(I));

1 month ago | 0

Answered
find 'last' function not working
Beside using 'any'/'all', you might make two modifications to get what you want [Monotonic_last_row, ~] = find(~isnan(Monotonic...

1 month ago | 1

Answered
How to create a simple matrix from two different kind of matrix size ?
M1 = rand(2,5,2) ; M2 = rand(2,5) ; reshape(cat(3,M1,M2),size(M1,1),[])

1 month ago | 1

| accepted

Load more