This site is to serve as my note-book and to effectively communicate with my students and collaborators. Every now and then, a blog may be of interest to other researchers or teachers. Views in this blog are my own. All rights of research results and findings on this blog are reserved. See also http://youtube.com/c/hongqin @hongqin
Sunday, June 24, 2018
insert figures into Rmd, example
---
title: "sandbox"
author:
date: "June, 2018"
output: html_document
---
```{r}
library("pracma")
library("Smisc")
```
#Run these matrices from Yuan2013
#ToDo in the next version
#next build a data structure to run more networks systematically.
#plug in these matrices into matrix A variable above
#then find n_D
![YuanFig1](figures/fig1.yuan.png)
```{r fig1A_a}
A_a<-matrix(c(0,1,1,1,1,1,1,1,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0),nrow=6,ncol=6)
A_a;
eig<-eigen(A_a);
eig;
#functionND(A_a)
```
```{r fig1A_b}
A_b<-matrix(c(1,0,0,0,0,0,1,1,0,0,0,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,1,1,1,0,0,0,0,1),nrow=6,ncol=6)
A_c<-matrix(c(0,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0),nrow=6,ncol=6)
```
#nd_names = c( 'network','network_size','eigen-values','eigen-vectors','nd')
#nd= data.frame(matrix(, nrow=3, ncol=length(nd_names)) #set up a skeleton table
#names(nd) = c( "network","network_size","eigen-values","eigen-vectors","nd")
```{r}
#result<-data.frame(network_name=c("A_a","A_b","A_c"),
# network_size=c(length(A_a[1,]),length(A_b[1,]),length(A_c[1,])),
# driver_nodes=c(functionND(A_a),functionND(A_b),functionND(A_c)));
#result;
```
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment