Wed 26 Jul 2017 11:50:48 AM UTC, original submission:
The following code works fine on Matlab but fails on Octave:
-----------------------------------------------------------
% Form the matrix of weights based on the graph
N = 11;
W = zeros(N,N);
W(1,2) = 0.5;
W(1,5) = 0.5;
W(2,3) = 0.6;
W(3, 4) = 0.6;
W(4,5) = 0.6;
W(4,6) = 0.1;
W(5, 7) = 0.2;
W(6,7) = 0.8;
W(7,8) = 0.4;
W(8,9) = 0.5;
W(9,10) = 0.7;
W(10,11) = 0.7;
W(11,6) = 0.8;
% Since it's undirected add on the transpose to assign the edges in the
% other direction
W = W + W';
% Examine the structure of the weights matrix
spy(W)
% Form the degree matrix, D
D = diag(sum(W,2));
% Form the Laplacian
L = D - W;
% Find the eigenvectors and eigenvalues
[evec,eval] = eig(L, 'vector');
error: eig: wrong type argument 'sq_string'
---------------------------------------------
using [evec,eval] = eig(L, "vector");
error: eig: wrong type argument 'string'
---------------------------------------------
Tom
|