Is there another way to plot a graph 3D without digraph ?
Show older comments
Hi everybody, I want to do something using Matlab 2014 that mimic digraph of Matlab 2015.
% let's say we have 3 vectors of x,y,z coordinates of 11 nodes
x = [2 5 6 2 8 4 9 1 6 2 3];
y = [3 1 9 6 7 5 4 2 3 6 8];
z = [2 6 9 6 3 2 4 7 5 8 9];
% we also have the interactions Matrice A between those nodes.
A = [0 1 1 0 0 1 0 1 1 0 0 ; -1 0 -1 0 0 -1 0 0 -1 0 0 ; 1 1 0 0 0 1 0 1 0 1 1 ; 0 0 0 0 -1 -1 0 -1 0 -1 0; -1 -1 -1 0 0 -1 0 -1 -1 0 0 ; -1 -1 0 0 -1 0 0 0 -1 0 0 ; 1 0 1 0 0 1 0 0 0 1 0 ; 0 1 0 1 1 1 0 0 0 1 0 ; 1 1 0 1 0 0 1 1 0 0 1 ; 1 0 1 0 0 0 1 1 0 0 1 ; 0 0 0 -1 0 0 -1 -1 0 -1 0];
% we also have the strength Matrice B, of those interactions.
B = [0 1 7 0 0 3 0 2 6 0 0 ; 5 0 3 0 0 3 0 0 7 0 0 ; 5 1 0 0 0 1 0 2 0 9 7 ; 0 0 0 0 3 7 0 1 0 4 0; 6 5 3 0 0 7 0 3 3 0 0 ; 8 9 0 0 6 0 0 0 9 0 0 ; 9 0 1 0 0 8 0 0 0 9 0 ; 0 1 0 3 6 3 0 0 0 8 0 ; 1 6 0 3 0 0 1 8 0 0 9 ; 8 0 3 0 0 0 6 1 0 0 1 ; 0 0 0 3 0 0 9 5 0 3 0];
% The strength will be perceived on the graph as the intensity of the given color blue or red.
We may also use dash ------, - - - - - -, - - - - - -, motif to differentiate between 9 to 1, or something else, depending on you, or even write the number dirrectlly on the narrow as it is done in digraph.
% naturally, interactions between a given neuron and itself = 0 if you look very well, 1 = blue narrow, -1 = red narrow.
% and we have the real distance between 2 node is a kid of curve(same like what we see in 2015)
% the curve length is the cartesien distance + (% 0 to 10 % that cartesien distance)(I have already written the function that do that). To make it easy for you, let s consider only the cartesien distance (strait lines).
% How can we plot this graph ?
1 Comment
NA
on 12 Feb 2020
What is strength Matrice?
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

