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

Professional Interests: Mathematical Computing

Answered

How to calculate the derivative and deviation of a series of data

To find deviation i.e standard deviation use std. To find derivative ..if you have time step use... d = diff(data)/dt ; Alo...

How to calculate the derivative and deviation of a series of data

To find deviation i.e standard deviation use std. To find derivative ..if you have time step use... d = diff(data)/dt ; Alo...

ongeveer 16 uur ago | 0

Answered

How to run a code several times using a for loop

Make your given code into a function with input and output. Output should be your required matrices/ data. Make output into ...

How to run a code several times using a for loop

Make your given code into a function with input and output. Output should be your required matrices/ data. Make output into ...

1 dag ago | 0

Answered

K means image clustering with time series data

Let x be your 1D data. Assuming it column vector. t = 1:length(x); t = t'; idx = kmeans([t x],3);

K means image clustering with time series data

Let x be your 1D data. Assuming it column vector. t = 1:length(x); t = t'; idx = kmeans([t x],3);

1 dag ago | 0

| accepted

Answered

How do I take the 'left' side of a matrix? (row-wise)

For your first example: b = a(:,1:3) ; If A is your matrix..if your first first n columns B = A(:,1:n) ; If you want fir...

How do I take the 'left' side of a matrix? (row-wise)

For your first example: b = a(:,1:3) ; If A is your matrix..if your first first n columns B = A(:,1:n) ; If you want fir...

2 dagen ago | 0

Answered

Making a matrix act like a coordinate plane

x = -50:50 ; y = -50:50 ; [X,Y] = meshgrid(x,y) ;

Making a matrix act like a coordinate plane

x = -50:50 ; y = -50:50 ; [X,Y] = meshgrid(x,y) ;

3 dagen ago | 0

| accepted

Answered

get indices where the value is 0

Let A be your vector....to get indices of zero use... idx = find(A==0) ; % gives indices directly idx_l = A==0 ; % gives...

get indices where the value is 0

Let A be your vector....to get indices of zero use... idx = find(A==0) ; % gives indices directly idx_l = A==0 ; % gives...

3 dagen ago | 0

Answered

Two different ways of using iterations

In the first case, you are not saving the result. Check the below. load tal v_stor=zeros(1,length(V)); v_liten=zeros(1,lengt...

Two different ways of using iterations

In the first case, you are not saving the result. Check the below. load tal v_stor=zeros(1,length(V)); v_liten=zeros(1,lengt...

3 dagen ago | 1

Answered

How to store vector in a loop and print into excel file all at once?

You are wrtitng R in the xlswrite command. Replace R with Es. L = length(y_train_corr(1,:)); R = corrcoef(y_train_corr(:,2),y_...

How to store vector in a loop and print into excel file all at once?

You are wrtitng R in the xlswrite command. Replace R with Es. L = length(y_train_corr(1,:)); R = corrcoef(y_train_corr(:,2),y_...

4 dagen ago | 0

Answered

f(x,y)<=0

It depends on what your function f is. Your function f will show some relation between x and y. Also you should define range of ...

f(x,y)<=0

It depends on what your function f is. Your function f will show some relation between x and y. Also you should define range of ...

4 dagen ago | 0

Answered

Problems of convert decimal number to a string

iwant = sprintf("0.12f 0.12f 0.12f",num) ; Try with sprintf. You can split each number into a cell using num2cell, and use ce...

Problems of convert decimal number to a string

iwant = sprintf("0.12f 0.12f 0.12f",num) ; Try with sprintf. You can split each number into a cell using num2cell, and use ce...

4 dagen ago | 0

Answered

Put every 3 data points in matrix A into a separate row in matrix B.

A = 1:9 ; iwant = reshape(A,3,3)' ;

Put every 3 data points in matrix A into a separate row in matrix B.

A = 1:9 ; iwant = reshape(A,3,3)' ;

5 dagen ago | 0

| accepted

Answered

How can i make my results occupy less space on my plot?

n = 101; % Number of grids dy = 1.0 / (n-1); Re = 100; % Reynolds Number we define phi_new = zeros(1,n); % St...

How can i make my results occupy less space on my plot?

n = 101; % Number of grids dy = 1.0 / (n-1); Re = 100; % Reynolds Number we define phi_new = zeros(1,n); % St...

6 dagen ago | 1

| accepted

Answered

Montage Function Problems in MATLAB

Try montage({im11, im22, im33, im44}) ; If all your images are 3D, try montage(cat(3,img1,img2,img3,img4)) ;

Montage Function Problems in MATLAB

Try montage({im11, im22, im33, im44}) ; If all your images are 3D, try montage(cat(3,img1,img2,img3,img4)) ;

6 dagen ago | 0

Answered

How to Run a Code for all files in a folder

You input the filename to the function transformdata and save the output into cells. files = dir('*.csv') ; N = length(files...

How to Run a Code for all files in a folder

You input the filename to the function transformdata and save the output into cells. files = dir('*.csv') ; N = length(files...

6 dagen ago | 0

| accepted

Answered

if greater than in for loop

for k = 1:length(seven) if seven(k) > 100 seven(k) = seven(k) - 25 ; end end

if greater than in for loop

for k = 1:length(seven) if seven(k) > 100 seven(k) = seven(k) - 25 ; end end

7 dagen ago | 0

| accepted

Answered

how to get coordinates of a marker

You can plot your required circle given center and radius using the below method. C = [346 278] ; % Center of the circle R ...

how to get coordinates of a marker

You can plot your required circle given center and radius using the below method. C = [346 278] ; % Center of the circle R ...

7 dagen ago | 0

| accepted

Answered

How can I color the pixels of my image depending of it's value in an equation?

Let I be your image pixle matrix with the values Prob repalced using the shown formula. % To repalce values less than Prob id...

How can I color the pixels of my image depending of it's value in an equation?

Let I be your image pixle matrix with the values Prob repalced using the shown formula. % To repalce values less than Prob id...

7 dagen ago | 0

Answered

Insert missing values in specified positions and use for loop

This problem is dicussed multiple times....you can checki there in this useful link: https://in.mathworks.com/matlabcentral/ans...

Insert missing values in specified positions and use for loop

This problem is dicussed multiple times....you can checki there in this useful link: https://in.mathworks.com/matlabcentral/ans...

8 dagen ago | 0

| accepted

Answered

How do I colour a band between 2 sets of data of different length

x=randn(1,200) ; t=1:200 ; y=4+randn(1,180); t1=1:180 ; % Append NaN's in y1 to extend it to 1:200. n = length(t)-length(...

How do I colour a band between 2 sets of data of different length

x=randn(1,200) ; t=1:200 ; y=4+randn(1,180); t1=1:180 ; % Append NaN's in y1 to extend it to 1:200. n = length(t)-length(...

8 dagen ago | 0

Answered

Contour on a contourf plot

contourf gives you a colored plot. It fills the contour lines region with colors. To get whay you want use: c = contour(Xi,Yi,Z...

Contour on a contourf plot

contourf gives you a colored plot. It fills the contour lines region with colors. To get whay you want use: c = contour(Xi,Yi,Z...

8 dagen ago | 0

| accepted

Answered

Extracting data from Text file

fid = fopen("Ocb_pl.txt") ; S = textscan(fid,"%d %f %f %f %f\n",'HeaderLines',135) ; fclose(fid) ; S{1}

Extracting data from Text file

fid = fopen("Ocb_pl.txt") ; S = textscan(fid,"%d %f %f %f %f\n",'HeaderLines',135) ; fclose(fid) ; S{1}

8 dagen ago | 0

Answered

How to select the first appearance of the minimum value?

d = abs(A-b) ; [d,idx] = sort(d) ; % sort them in increasing order iwant = min(A(idx(1:2))) You can try knnsearch...read ab...

How to select the first appearance of the minimum value?

d = abs(A-b) ; [d,idx] = sort(d) ; % sort them in increasing order iwant = min(A(idx(1:2))) You can try knnsearch...read ab...

8 dagen ago | 1

| accepted

Answered

How to calculate average of three columns from textfile?

txtFiles = dir('*.txt') ; % get all files N = length(txtFiles) ; % total number of files M = zeros(N,3) ; % mean int...

How to calculate average of three columns from textfile?

txtFiles = dir('*.txt') ; % get all files N = length(txtFiles) ; % total number of files M = zeros(N,3) ; % mean int...

8 dagen ago | 0

Answered

Shrink image without using imresize

Let I be your image of size 1200x1100. [m,n,p] = size(I) ; [X,Y] = meshgrid(1:m,1:n) ; xi = linspace(1,m,650) ; yi = lin...

Shrink image without using imresize

Let I be your image of size 1200x1100. [m,n,p] = size(I) ; [X,Y] = meshgrid(1:m,1:n) ; xi = linspace(1,m,650) ; yi = lin...

8 dagen ago | 0

| accepted

Answered

Problem in contour plot using ''for '' loop.

May be you are looking for contour(T,G,M)

Problem in contour plot using ''for '' loop.

May be you are looking for contour(T,G,M)

8 dagen ago | 0

Answered

How to ensure that the value in my mxn matrix does not exceed certain value?

for i = 1:2 for j = 1:2 A(i,j) = input("enter value:") ; while A(i,j) > 2 A(i,j) = input("enter value, less...

How to ensure that the value in my mxn matrix does not exceed certain value?

for i = 1:2 for j = 1:2 A(i,j) = input("enter value:") ; while A(i,j) > 2 A(i,j) = input("enter value, less...

8 dagen ago | 0

Answered

How can i extract specific points that meet a condition from given data?

I will use histogram, and get the indices. clc; clear all ; data = importdata("xycoords.txt") ; x = data(:,1) ; y = dat...

How can i extract specific points that meet a condition from given data?

I will use histogram, and get the indices. clc; clear all ; data = importdata("xycoords.txt") ; x = data(:,1) ; y = dat...

8 dagen ago | 0

| accepted

Answered

Counting elements in cell array

If C is your cell array of strings. n = nnz(strcmp(C,'cat'));

Counting elements in cell array

If C is your cell array of strings. n = nnz(strcmp(C,'cat'));

8 dagen ago | 0

| accepted

Answered

How can the center be determined by the Kmeans method?

[idx,C,D] = kmeans(grayImge(:),numberOfclasses) ; C is your cneter. Read about kmeans. You can your center along with the fu...

How can the center be determined by the Kmeans method?

[idx,C,D] = kmeans(grayImge(:),numberOfclasses) ; C is your cneter. Read about kmeans. You can your center along with the fu...

8 dagen ago | 0

| accepted