Question


Release note of the update?
Is there a release note for the update in general, for Update2 R2018B in particular? Just wonder since the update 2 of R2018B a...

7 years ago | 1 answer | 0

1

answer

Answered
Optimize the Max Min over two sets for the given function
For ant row a_j, the inner equation argmin_lambda || sum (lambda_i * b_i - a_j) ||^2 lambda >= 0 sum(lambda_i) = 1 can be s...

7 years ago | 0

Answered
How to efficiently compare two matrix to get a single reference value?
TrueVal= [1 1 1 2 2 2 3 3 3 1 2]'; Predicted=[1 2 3 1 2 3 1 2 3 3 2]'; [ut,~,it] = unique(TrueVal); [up,~,ip] = unique(Pre...

7 years ago | 0

Answered
Flipping a plot by 180 degrees
[x,y]=find(peaks>0.7) close all subplot(2,1,1); plot(x,y,'or') subplot(2,1,2); plot(x,y,'or'); % This command will r...

7 years ago | 1

| accepted

Answered
gauss elimination or inverse
P = polyfit(x(:),y(:),n-1); a = P(1); b = P(2); ... c = P(n);

7 years ago | 1

Answered
Error using:mtimesx_build.m
If you run recent MATLAB you also must change the line #166 of mtimex_build.m to mexopts = [prefdir '\mex_C_win64.xml'];

7 years ago | 0

Answered
replacing for loop with more efficient code
% Generate test matrices m = 5; n = 10; S = rand(n,n); S = 0.5*(S + S.'); X = rand(n,n); X = 0.5*(X + X.'); A = zeros(n...

7 years ago | 0

| accepted

Answered
Generate N random uniformly distributed points in the d-ball
d = 3 n = 10000; % s is (d x n), n points in unit d-ball s = randn(d,n); r = rand(1,n).^(1/d); c = r./sqrt(sum(s.^2,1)); ...

7 years ago | 0

Answered
Difference between angle2dcm and eul2rotm (same angle sequence, different result)
I check and the eul2rotm command returns the rotation matrix according to Wikipedia definition of euler z-y'-x" intrinsic to rot...

7 years ago | 1

Answered
Average the 3rd dimension in a matrix
Mean every 4 indices of the third dimension A=rand(360,181,360); [m,n,p] = size(A); m = mean(permute(reshape(A,m,n,4,[]),[1 ...

7 years ago | 0

| accepted

Answered
Remove rows with consecutive numbers
A = [1 2 3 4 5; 3 5 7 9 11; 1 1 4 5 7; 3 5 6 6 9; ...

7 years ago | 0

Answered
How to find curvature(k) of plane curve have having using it's position points (x & y) equally spaced with arc length s.
Big Curvature -> red Small Curvature -> blue % Dummy test data t = 1:7; x = rand(size(t)); y = rand(size(t)); fx = spl...

7 years ago | 0

| accepted

Answered
Is there a way to start indexing with 0 in MATLAB?
Yes, but you won't get much support by built-in array stock function >> M = containers.Map('KeyType','uint32','ValueType','dou...

7 years ago | 3

Answered
Rotational symmetries of cubic crystal structures
xcord=[0 1 0 0 1 1 0 1]; ycord=[0 0 1 0 1 0 1 1]; zcord=[0 0 0 1 0 1 1 1]; xyz = [xcord; ycord; zcord]; theta = pi/3; M =...

7 years ago | 1

Answered
how to find maximum distance of convex polygon for each point in a convex hull?
This is a method that provides the maximum distance that has better complexity than computing distance of all pairs as other ans...

7 years ago | 0

Answered
Rotate a Matrix by Finding an Axis
Here is the code to find the largest distance between 2 white pixels. Once finding it you can compute the angle and rotate the ...

7 years ago | 0

| accepted

Answered
Optimize the Max Min over two sets for the given function
Not sure why this bla-bla about convex that makes your statement confusing. There is no continuous variable in the quantity f2 =...

7 years ago | 0

Answered
Solve for diagonal matrix D by minimizing the operator norm in Matlab
fminunc, fmincon and family.

7 years ago | 1

| accepted

Answered
Creating an image of first non-zero values in a 3d matrix
[maxval,firstNonZero] = max(im_datacube ~= 0, [], 3); firstNonZero(~maxval) = NaN; % pixel where 1 is not found along the 3rd d...

7 years ago | 1

| accepted

Answered
Determine eigvector through eigvalue without using eig
null(A - lambda * eye(size(A))

7 years ago | 0

Answered
How to count the number of consecutive identical element of each row in a binary matrix?
A = [0 0 0 0 1 1 0 0; 1 0 1 1 1 1 0 0; 0 1 1 0 1 0 0 1] m = size(A,1); B = A'; b = [true(1,m); diff(B)~=0]; ...

7 years ago | 2

| accepted

Answered
Matlab 2014b bug: Warning: Matrix is singular to working precision.
The problem is this "Warning: Matrix is singular to working precision." That means you matrix inversion is unstable, illposed,...

7 years ago | 1

Answered
Calculate volume from an isosurface
If your iso surface is get from isosurface() command then your volume is set of voxels V <= isovalue or V >= isovalue So ...

7 years ago | 1

| accepted

Answered
fast interp on 1 dimension of 3d matrix
[m,n,p] = size(A); B = reshape(A,[m*n p]).'; Br = resample(B,2,1); % 2 is upsampling factor Ar = reshape(Br.',m,n,[]);

7 years ago | 0

Answered
Can pareto optimality be used to solve the travelling salesman problem?
Just change the definition "distance" between 2 cities to, for example d = sqrt((1/dx)^2 + dy^2) and feet it TSP algo. Note...

7 years ago | 1

| accepted

Answered
how to get polynomial fit for the set of data points????
You might fit parametric, so it meets yours question since it's polynomial. xy=xlsread('E:\MATLAB\data points.xlsx',1) x=xy(:,...

7 years ago | 0

Answered
how to fit segmental regession with matlab
Look like this recent thread also answers your question

7 years ago | 1

Answered
Gauss Curve Point of Inflection
If you know the curve is Gaussian, the inflection points can be computed directly from curve parameters. For Gaussian curve cent...

7 years ago | 0

Answered
Can anyone solve this? Find the shortest distance between the plane 3*x1+4*x2+x3=1 and the point (-1,1,1). (optimization problem?)
n = [3;4;1]; d = abs((n'*[-1;1;1]-1)/sqrt(n'*n)) gives: d = 0.1961

7 years ago | 2

Load more