[Solved] distance points 3D [duplicate]

[ad_1] If you don’t have the statistics toolbox, it is not the correct function to use. If you do – then it is one of many functions you could use. You can also do something like: sz = size(A); A1 = reshape(A, [1 sz]); A2 = permute(A1, [2 1 3]); D = sqrt(sum(bsxfun(@minus, A1, A2).^2,3)); … Read more

[Solved] Jensen-Bregman LogDet divergence [closed]

[ad_1] As I understand it the function (of two symmetric positive definite matrices) is JL(X,Y) = log( det( (X+Y)/2)) – log( det( X*Y))/2 = log( det( (X+Y)/2)) – (log(det(X)) + log(det(Y)))/2 I reckon the way to do this is to compute the cholesky factorisations of X, Y and (X+Y)/2, that is find lower triangular matrices … Read more

[Solved] What is the syntax error “Error: Unbalanced or unexpected parenthesis or bracket.”? [closed]

[ad_1] Looks like you are missing a closing parenthesis, at least, in the second to last line where you have .*sin((y).*sin(z), and missing a * (or another operator) between your )( in several lines. In MATLAB (A)(B) is not A*B. 8 [ad_2] solved What is the syntax error “Error: Unbalanced or unexpected parenthesis or bracket.”? … Read more

[Solved] How to rewrite this Matlab 2014 code with axis-subplots to 2016?

[ad_1] You can simply write: figure(‘Units’,’inches’); b1 = subplot(2,2,1); b2 = subplot(2,2,2); b3 = subplot(2,2,3); b4 = subplot(2,2,4); or preferably, if you want to have an array of the axes: figure(‘Units’,’inches’); b(1) = subplot(2,2,1); b(2) = subplot(2,2,2); b(3) = subplot(2,2,3); b(4) = subplot(2,2,4); or use a simple for loop: figure(‘Units’,’inches’); b(1:4) = axes; for k … Read more

[Solved] How to Shift an array circularly on VBA [closed]

[ad_1] Option Explicit Option Base 1 Sub shiftCircArray() Dim iInputArray(3) As Integer iInputArray(1) = 1 iInputArray(2) = 2 iInputArray(3) = 3 Dim iArray2() As Integer iArray2 = RotateArrayRight(iInputArray) End Sub Function RotateArrayRight(ArrayToRotate) Dim objNewArray() As Integer, iOldArrayPos As Integer, iNewArrayPos As Integer, iArrayLength As Integer Dim iPlacesToRotate As Integer ‘ Check that the array to … Read more

[Solved] Matlab While statement [closed]

[ad_1] as the error says, you brackets is not in pairs. change while(norm(g_k)/(max(1,norm(v_k)) > eps && iter < iterMax) to while(norm(g_k)/max(1,norm(v_k)) > eps && iter < iterMax) [ad_2] solved Matlab While statement [closed]

[Solved] Store numbers in an array in MATLAB

[ad_1] Just use the following code: num = []; % ToInitializeTheArray for i=1:5 num = input(‘Enter value or enter 100 to stop: ‘); num(end+1)=num; end I’m new to MathLab myself I hope this helped 1 [ad_2] solved Store numbers in an array in MATLAB