Community Profile

# Aswin Sandirakumaran

Active since 2018

#### Content Feed

View by

Question

How to check number of zeros in an array?
Eg: I have a vector A = [0,0,4,3] and B = [0,1,2,3,4] and C = [0,0,0,0,0] and D = [0,1,2,0,0] *SO THE OUTPUT SHOULD CONTAIN ...

4 years ago | 2 answers | 0

### 2

Question

How to find distance between two nodes? including the nodes.
_* For example: In this graph i would like to find distance *between s1 and s3.*_ *SO MY OUTPUT SHOULD LOOK LIKE : Distance...

4 years ago | 2 answers | 0

### 2

Question

How to change node names and divide and print the individual graph?
I have this graph Gp = graph({'n1' 'n1' 'n2' 'n2' 'n3' 'n4'},{'n2' 'n4' 'n3' 'n4' 'n5' 'n5'}); *how to change node na...

4 years ago | 0 answers | 0

### 0

Question

How to fix this loop?
C = {1,2,3,1,4,6}; %for i = 1:length(C) List = cell(size(C)); %creating empty list for i = 1:length(C) ...

4 years ago | 1 answer | 0

### 1

Question

How to track the lists generated in each for loop?
Gv = graph({'s1' 's_1' 's2' 's_2' },{'s2' 's_2','s3' 's_3'}); Gv.Nodes.Memory = [8,8,7,7,8,7]'; Gv.Nodes.Service = {...

4 years ago | 0 answers | 0

### 0

Question

How to fix this issue in the graph??
Gv = graph({'s1' 's_1' 's2' 's_2' },{'s2' 's_2','s3' 's_3'}); Gv.Nodes.Service = {'s1','s2','s_1','s_2','s3','s_3'}'; Ap...

4 years ago | 1 answer | 0

### 1

Question

how to plot H in this code? I have some difficulties?
Gv = graph({'s1' 's_1' 's2' 's_2' },{'s2' 's_2','s3' 's_3'}); Gv.Nodes.Service = {'s1','s2','s_1','s_2','s3','s_3'}'; Ap...

4 years ago | 0 answers | 0

### 0

Question

How to add nodes and display it as a graph??
G = graph(); j = [1,2,3,4,5]; for i = 1:length(i) H = addnode(G,j(i)); plot(H); end *QUESTION: Ho...

4 years ago | 1 answer | 0

### 1

Question

How to remove a row from the table?
Gv = graph({'s1' 's_1' 's2' 's_2' },{'s2' 's_2','s3' 's_3'}); figure(1) hold on Gv.Nodes.Availability = {'null'...

4 years ago | 1 answer | 0

### 1

Question

How to fix this code? It doesnt give me an edge from 1 to 2! what is the problem in my code?
p = [3,2,1]; for i = 1:length(p) last_element = p(end); G = graph(); H = addnode(G,last_element); p(end...

4 years ago | 2 answers | 0

### 2

Question

How to add nodes and edges?
p = [3,2,1]; for i = 1:length(p) last_element = p(end); G = graph(); H = addnode(G,last_element); *HOW TO ADD EDG...

4 years ago | 1 answer | 0

### 1

Question

how to draw graph in matlab? Using Biograph?
How to draw biograph with labels corresponding to values in p vector? if true p = [1,2] for i=0 : length(p) ...

4 years ago | 1 answer | 0

### 1

Question

D = [60,600,15]; A(2) = D(2); -> OUTPUT OF A LOOKS LIKE A = [0,600] B(3) = D(3); -> OUTPUT OF B LOOKS LIKE B = [0,0,15...

4 years ago | 2 answers | 0

### 2

Question

How to combine two vectors? HOW TO SPLIT VECTORS ACCORDING TO INDEX?
I have a vector say A = [60,600,15] I extract any value from this vector A using its index Eg: If i extract A(2) from A. T...

4 years ago | 1 answer | 0

### 1

Question

how to insert an element into any index of vector?
CASE 1 : A = [540] B = [0,15] How to insert B(1) as A(1) and B(2) as A(3) ===>>> OUTPUT SHOULD BE LIKE: A = [0,540,15...

4 years ago | 2 answers | 0

### 2

Question

How to attach the element into correct index
I HAVE VECTOR A = [0,540] B = [60,600,15] how to attach B(3) as A(3) ? //output should be A = [0,540,15] how to...

4 years ago | 1 answer | 0

### 1

Question

how to fill in zeros in index not used?
I need to create a vector B with length = 3; And i know that B(2) = 5; Then how to fill B(1) = 0 and B(3) = 0; *Output*...

4 years ago | 2 answers | 0

### 2

Question

How to compare and copy the value of one vector to another?
I have a VECTOR A = [0,540] and B = [60,600,15] Lets say i have index = 1 for A(1) = 0 ...

4 years ago | 0 answers | 0

### 0

Question

How to fix this loop to get the desired output ?
New_Td = [4,1,1] for t = New_Td for b = 1:t duplicate(b) = 0; r(b) = 0; fprintf('Hai f...

4 years ago | 1 answer | 0

### 1

Question

How to do this loop?
I have a vector A = [4,2,3] for 1: do this end how to make this for loop execute as number of times as i...

4 years ago | 0 answers | 0

### 0

Question

How to do the loop
I have a vector A = [0,0,0] & B = [4,2,1] i = 1:length(B) -->> I am not sure about this part while (A(i) <= B(i)) A(...

5 years ago | 0 answers | 0

### 0

Question

How to extract last element from the lists
Suppose if my List has list = {[1,2],2,[],[1,2,3]} eg: list{1} = [1,2] = %% print last element ==>> 2 list{2} = 2 ...

5 years ago | 1 answer | 0

### 1

Question

How to compare two vectors and output the index?
For eg: A = [60,600,15] B = [60,512,30,13] Now, take B(1) (60 here) and compare it with A(1)(60 here) If 60<=60 prin...

5 years ago | 2 answers | 0

### 2

Question

How to match two arrays with its index and extract the value ?
For Eg: B = [ 60,600,15]; C = [10^(-4),10^(-9),10^(-7)]; Here we need to look for the minimum value in the array C and ...

5 years ago | 1 answer | 0

### 1

Question

How to Compare two arrays and do something if it is less ? The algorithm should work as below mentioned
A=[1,2,3,4,5] B=[6,7,8] then the code should take the 1st element in A (ie. 1) and compare it with B, if ( the first element is ...

5 years ago | 0 answers | 0