https://sites.google.com/site/kolukulasivasrinivas/

Professional Interests: Mathematical Computing

Answered

Extract data between thresholds

A = load('test.txt') ; A = A' ; ii = zeros(size(A)); jj = A > 0; ii(strfind([0,jj(:)'],[0 1])) = 1; idx = cumsum(ii).*jj; ...

Extract data between thresholds

A = load('test.txt') ; A = A' ; ii = zeros(size(A)); jj = A > 0; ii(strfind([0,jj(:)'],[0 1])) = 1; idx = cumsum(ii).*jj; ...

1 day ago | 0

| accepted

Answered

Skipping a NaN in a loop

A = rand(5) ; % data for demo A(:,2) = NaN ; % replace a column with NaN for i = 1:5 if any(isnan(A(:,i))) ...

Skipping a NaN in a loop

A = rand(5) ; % data for demo A(:,2) = NaN ; % replace a column with NaN for i = 1:5 if any(isnan(A(:,i))) ...

1 day ago | 0

Answered

How can I add angular noise to my vector?

Read about rand. X = X+rand(size(X)) ;

How can I add angular noise to my vector?

Read about rand. X = X+rand(size(X)) ;

1 day ago | 0

Answered

How Can I solve this problem?

USe .^ instead of ^. H = 3; P = 100; ls = atan(P/H); fun = @(x) (2*(H/P)^2)*(x + (4/3)*x.^3 + (17/15)*x.^5 + (248/315)*x.^7...

How Can I solve this problem?

USe .^ instead of ^. H = 3; P = 100; ls = atan(P/H); fun = @(x) (2*(H/P)^2)*(x + (4/3)*x.^3 + (17/15)*x.^5 + (248/315)*x.^7...

1 day ago | 0

Answered

Trying to save a Matlab file with a timestamp

for i = 1:10 data = rand(100,1) ; fname = strcat('projjectile',string(datetime('now','Format',"yyyy-MM-dd-HH-mm-ss"))...

Trying to save a Matlab file with a timestamp

for i = 1:10 data = rand(100,1) ; fname = strcat('projjectile',string(datetime('now','Format',"yyyy-MM-dd-HH-mm-ss"))...

1 day ago | 0

| accepted

Answered

Add xyz arrows in plot

% points x = rand(50,1) ; y = rand(50,1) ; z = rand(50,1) ; % vectors u = rand(50,1)/10 ; v = rand(50,1)/10 ; w = r...

Add xyz arrows in plot

% points x = rand(50,1) ; y = rand(50,1) ; z = rand(50,1) ; % vectors u = rand(50,1)/10 ; v = rand(50,1)/10 ; w = r...

2 days ago | 1

| accepted

Answered

How do I plot the equipotential lines in matlab?

L = 1 ; x = linspace(-0.5,+0.5) ; lambda = sin(pi*x/L) ; plot(x,lambda)

How do I plot the equipotential lines in matlab?

L = 1 ; x = linspace(-0.5,+0.5) ; lambda = sin(pi*x/L) ; plot(x,lambda)

2 days ago | 0

Answered

How to merge different data collected at different times?

Read all the files and save time of each file. Get the minimum and maximum of time out of the three files. Create date time a...

How to merge different data collected at different times?

Read all the files and save time of each file. Get the minimum and maximum of time out of the three files. Create date time a...

2 days ago | 0

Answered

Unable to convert expression into double array

This line: subs(diff) You have to substitute some value right? I guess you need to input value of t here......

Unable to convert expression into double array

This line: subs(diff) You have to substitute some value right? I guess you need to input value of t here......

2 days ago | 0

Answered

Machine learning for images dataset

If you have images to train the best you have imageDatastore. https://in.mathworks.com/help/matlab/ref/matlab.io.datastore.ima...

Machine learning for images dataset

If you have images to train the best you have imageDatastore. https://in.mathworks.com/help/matlab/ref/matlab.io.datastore.ima...

2 days ago | 0

Answered

Take average of multiple matrices

load data.mat ; A = cat(3,phi_BFD_v_sum{:}) ; iwant = mean(A,3) ;

Take average of multiple matrices

load data.mat ; A = cat(3,phi_BFD_v_sum{:}) ; iwant = mean(A,3) ;

2 days ago | 1

Answered

Plot data in map with LAT LONG

Refer this: https://www.eoas.ubc.ca/~rich/map.html You may see the below example for plotting. x = LON ; y = LAT ; z = power ...

Plot data in map with LAT LONG

Refer this: https://www.eoas.ubc.ca/~rich/map.html You may see the below example for plotting. x = LON ; y = LAT ; z = power ...

2 days ago | 0

Answered

Extracting rows from table with specific digits

code = [{'116004.5'} {'116006.6'} {'120099.9'} {'120199.3'} {'120202.5'}] ; desc...

Extracting rows from table with specific digits

code = [{'116004.5'} {'116006.6'} {'120099.9'} {'120199.3'} {'120202.5'}] ; desc...

2 days ago | 0

Answered

Loading coordinates from workspace

x = rand(5,1) ; y = rand(5,1) ; z = rand(5,1) ; figure(1) plot3(x,y,z) ; figure(2) scatter(x,y,[],z)

Loading coordinates from workspace

x = rand(5,1) ; y = rand(5,1) ; z = rand(5,1) ; figure(1) plot3(x,y,z) ; figure(2) scatter(x,y,[],z)

3 days ago | 0

Answered

How can specify interval of variables in fsurf?

f1 = @(x,y) erf(x)+cos(y); x = -5:0.1:0 ; y = -5:0.2:5 ; [X,Y] = meshgrid(x,y) ; Z = f1(X,Y) ; surf(X,Y,Z)

How can specify interval of variables in fsurf?

f1 = @(x,y) erf(x)+cos(y); x = -5:0.1:0 ; y = -5:0.2:5 ; [X,Y] = meshgrid(x,y) ; Z = f1(X,Y) ; surf(X,Y,Z)

3 days ago | 1

Answered

Sum up values of corresponding date time intervals.

You can find the respective date indices using find or logical indexing. Once you know the first date and last date indices, you...

Sum up values of corresponding date time intervals.

You can find the respective date indices using find or logical indexing. Once you know the first date and last date indices, you...

3 days ago | 0

Answered

how to find the end point coordinates of an object in binary image.?

I = imread('image.png') ; I1 = rgb2gray(I) ; [y,x] = find(I1) ; [idx,C] = kmeans([x y],3) ; imshow(I) hold on plot...

how to find the end point coordinates of an object in binary image.?

I = imread('image.png') ; I1 = rgb2gray(I) ; [y,x] = find(I1) ; [idx,C] = kmeans([x y],3) ; imshow(I) hold on plot...

4 days ago | 0

Answered

cell array in cell array

n = length(a) ; iwant = zeros(n,1) ; for i = 1:n iwant(i) = a{i}{3} ; end

cell array in cell array

n = length(a) ; iwant = zeros(n,1) ; for i = 1:n iwant(i) = a{i}{3} ; end

4 days ago | 1

Answered

How do I get a graph to spiral

t = linspace(0,10*pi,5000); r = 5. ; c = 4 ; x = r*cos(t) ; y = r*sin(t) ; z = c*t ; comet3(x,y,z) ; plot3(x,y,z,'Color'...

How do I get a graph to spiral

t = linspace(0,10*pi,5000); r = 5. ; c = 4 ; x = r*cos(t) ; y = r*sin(t) ; z = c*t ; comet3(x,y,z) ; plot3(x,y,z,'Color'...

4 days ago | 1

Answered

How to separate the data in the table for loop?

Let C be your cell array. A = cell2mat(C(:)) ; A1 = A(:,1) % first column

How to separate the data in the table for loop?

Let C be your cell array. A = cell2mat(C(:)) ; A1 = A(:,1) % first column

4 days ago | 0

| accepted

Answered

Count EVEN and ODD numbers

clc; clear all ; a = input("Please enter 1st number: "); nE = 0 ; nO = 0 ; if mod(a,2)==0 disp("The 1st number is EVEN")...

Count EVEN and ODD numbers

clc; clear all ; a = input("Please enter 1st number: "); nE = 0 ; nO = 0 ; if mod(a,2)==0 disp("The 1st number is EVEN")...

4 days ago | 0

Answered

How do I create another column in a table which basically divides a T+1 / T number?

x = rand(10,1) ; y = rand(10,1) ; T = table(x,y) T.ratio = T.y./T.x

How do I create another column in a table which basically divides a T+1 / T number?

x = rand(10,1) ; y = rand(10,1) ; T = table(x,y) T.ratio = T.y./T.x

5 days ago | 0

Answered

Eliminating columns from the matrix

a=[0 12 13;0 5 4;0 9 6;0 8 9] idx = any(a)==0 ; a(:,idx)=[]

Eliminating columns from the matrix

a=[0 12 13;0 5 4;0 9 6;0 8 9] idx = any(a)==0 ; a(:,idx)=[]

5 days ago | 1

| accepted

Answered

Element change in a matrix

Let A be your matrix. B = A ; B(B<30) = 0 ; % replace < 30 to 0 B(B>=30 && B<75) = 1 ;

Element change in a matrix

Let A be your matrix. B = A ; B(B<30) = 0 ; % replace < 30 to 0 B(B>=30 && B<75) = 1 ;

5 days ago | 1

| accepted

Answered

Subtracts Two Cell Arrays to Yield a Third Array

Let C1 and C2 be two cell arrays of equal size and having same data each cell. N = length(C1) ; iwant = cell(N,1) ; for i =...

Subtracts Two Cell Arrays to Yield a Third Array

Let C1 and C2 be two cell arrays of equal size and having same data each cell. N = length(C1) ; iwant = cell(N,1) ; for i =...

5 days ago | 0

| accepted

Answered

How do we change the maximum number of parallel cores without a visual interface?

Read about preferences.

How do we change the maximum number of parallel cores without a visual interface?

Read about preferences.

5 days ago | 0

Answered

Get Two Cell Arrays To Same Size

load typevector_filtered.mat S = size(typevector_filtered{1}) ; for i = 1:length(typevector_filtered) if ~isequal(si...

Get Two Cell Arrays To Same Size

load typevector_filtered.mat S = size(typevector_filtered{1}) ; for i = 1:length(typevector_filtered) if ~isequal(si...

5 days ago | 0

| accepted

Answered

Can someone help with my syntax error

If A is your array to count number of times a number n (say 5) appears, follow: tol = 10^-5 ; idx = abs(A-n)<=tol ; nnz(idx(...

Can someone help with my syntax error

If A is your array to count number of times a number n (say 5) appears, follow: tol = 10^-5 ; idx = abs(A-n)<=tol ; nnz(idx(...

6 days ago | 0