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

Professional Interests: Mathematical Computing

Answered

Delete NaN in arrays in a cell

Let C be your cell array; iwant = C ; for i = 1:length(C) idx = isnan(C{i}) ; iwant{i} = C{i}(~idx) ; end

Delete NaN in arrays in a cell

Let C be your cell array; iwant = C ; for i = 1:length(C) idx = isnan(C{i}) ; iwant{i} = C{i}(~idx) ; end

11 hours ago | 1

| accepted

Answered

turn a sentence into matrix of words

str = 'I Love MATLAB' ; iwant = strsplit(str)

turn a sentence into matrix of words

str = 'I Love MATLAB' ; iwant = strsplit(str)

13 hours ago | 0

Answered

MATLAB: Index exceeds the number of array elements (1)

You are trying to extract more number of elements then present in the array. Example: A = rand(1,3) ; A(1) % no error A...

MATLAB: Index exceeds the number of array elements (1)

You are trying to extract more number of elements then present in the array. Example: A = rand(1,3) ; A(1) % no error A...

14 hours ago | 0

Answered

Concatenate 3-D matrix in a for loop

A = rand(2,3,4) ; B = rand(2,3,4) ; C = cat(1,A,B)

Concatenate 3-D matrix in a for loop

A = rand(2,3,4) ; B = rand(2,3,4) ; C = cat(1,A,B)

14 hours ago | 0

Answered

How to replace elements in a table using loops or any other method ?

C1 = {'Y' 'Y' 'N' 'Y' 'N'}' ; C2 = rand(size(C1)) ; T = table(C1,C2) ; % replace Y a 1 and N as 0 C = zeros(size(C1)) ; ...

How to replace elements in a table using loops or any other method ?

C1 = {'Y' 'Y' 'N' 'Y' 'N'}' ; C2 = rand(size(C1)) ; T = table(C1,C2) ; % replace Y a 1 and N as 0 C = zeros(size(C1)) ; ...

16 hours ago | 0

Answered

count of points in particular region from graph

You can proceed like below demo example: clc; clear all ; a = 1; b = 10 ; x = (b-a).*rand(1000,1) + a; y = (b-a).*rand(1...

count of points in particular region from graph

You can proceed like below demo example: clc; clear all ; a = 1; b = 10 ; x = (b-a).*rand(1000,1) + a; y = (b-a).*rand(1...

16 hours ago | 0

Answered

Have index of numbers and letters in title

It should be: t{n} = 'abc123abc';

Have index of numbers and letters in title

It should be: t{n} = 'abc123abc';

16 hours ago | 0

| accepted

Answered

How to make operation row by row

Use: FtempN =(1 + Alpha_pmp.* (AirTemp(1)-Tstc)) ;

How to make operation row by row

Use: FtempN =(1 + Alpha_pmp.* (AirTemp(1)-Tstc)) ;

17 hours ago | 0

Answered

How do I replicate curve fit figure with an equation?

You can use plot to plot the plane you want. Refer here: https://in.mathworks.com/help/curvefit/fit.html

How do I replicate curve fit figure with an equation?

You can use plot to plot the plane you want. Refer here: https://in.mathworks.com/help/curvefit/fit.html

18 hours ago | 0

Answered

exponential function remove the error of division

X1=30; Y1=20; X = 0:150; Y = Y1*exp(30./(X.^0.5)); plot(X,Y) Use element by element division.... ./

exponential function remove the error of division

X1=30; Y1=20; X = 0:150; Y = Y1*exp(30./(X.^0.5)); plot(X,Y) Use element by element division.... ./

18 hours ago | 0

Answered

Remove a string from another string

str1 = 'bio-inspired' ; str2 = 'bioinspired' ; str=setdiff(str1,str2)

Remove a string from another string

str1 = 'bio-inspired' ; str2 = 'bioinspired' ; str=setdiff(str1,str2)

18 hours ago | 0

| accepted

Answered

Unable to perform assignment because the size of the left side is 8-by-1 and the size of the right side is 8-by-1001.

The error is clear, you are trying to save more number of elements in the initilaized matrix. Example: A = zeros(3,3) ; % i...

Unable to perform assignment because the size of the left side is 8-by-1 and the size of the right side is 8-by-1001.

The error is clear, you are trying to save more number of elements in the initilaized matrix. Example: A = zeros(3,3) ; % i...

19 hours ago | 0

| accepted

Answered

How to set x > 0, at 2nd order polynomial using polyfit.

idx = x > 0 ; x = x(idx); y = y(idx) ; p2 = polyfit(x,y,2); f = polyval(p2,x); plot(x,f,'-')

How to set x > 0, at 2nd order polynomial using polyfit.

idx = x > 0 ; x = x(idx); y = y(idx) ; p2 = polyfit(x,y,2); f = polyval(p2,x); plot(x,f,'-')

19 hours ago | 0

| accepted

Answered

How to do one grouped graph showing months

t = datetime(2020,1,1):datetime(2020,12,31) ; y = rand(size(t)) ; % make required dates to plot jan_t = datetime(2020,1,[1...

How to do one grouped graph showing months

t = datetime(2020,1,1):datetime(2020,12,31) ; y = rand(size(t)) ; % make required dates to plot jan_t = datetime(2020,1,[1...

19 hours ago | 0

Answered

Plot error: Index exceeds the number of array elements (104).

plot(Ini_x,history(end).U_Euler(1,:))

Plot error: Index exceeds the number of array elements (104).

plot(Ini_x,history(end).U_Euler(1,:))

19 hours ago | 0

| accepted

Answered

How to plot data only certain days of a year.

You may proceed something like below: t = datetime(2020,1,1):datetime(2020,12,31) ; y = rand(size(t)) ; % random y-axis value...

How to plot data only certain days of a year.

You may proceed something like below: t = datetime(2020,1,1):datetime(2020,12,31) ; y = rand(size(t)) ; % random y-axis value...

19 hours ago | 0

Answered

How plot slope from lower point on image to last point .When I apply my code ,its not draw to end point in image

I = imread('image.png') ; [m,n,p] = size(I) ; imshow(I) ; hold on plot([1 m],[n 1],'b')

How plot slope from lower point on image to last point .When I apply my code ,its not draw to end point in image

I = imread('image.png') ; [m,n,p] = size(I) ; imshow(I) ; hold on plot([1 m],[n 1],'b')

1 day ago | 1

| accepted

Answered

Conditional matrix arrangement in output

x=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]; a=1; b=2; c=3; z = zeros(3,1) ; idx = x(:,1)<3 ; z(idx) = x(idx,2...

Conditional matrix arrangement in output

x=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]; a=1; b=2; c=3; z = zeros(3,1) ; idx = x(:,1)<3 ; z(idx) = x(idx,2...

1 day ago | 0

| accepted

Answered

How do i add a title and color bar

pause(.01); hold on grid off pcolor(Hz) title('PEC Boundary Condtion') colorbar; hold off ...

How do i add a title and color bar

pause(.01); hold on grid off pcolor(Hz) title('PEC Boundary Condtion') colorbar; hold off ...

1 day ago | 1

| accepted

Answered

Editing Legend/Plotting

Try: Mat_w = -.5:.5:.5; u = s\f; title('Case 2') hold on plot(Mat_w, u) xlim([-w,w]) legend('N=5','N=9', 'N=20');

Editing Legend/Plotting

Try: Mat_w = -.5:.5:.5; u = s\f; title('Case 2') hold on plot(Mat_w, u) xlim([-w,w]) legend('N=5','N=9', 'N=20');

1 day ago | 0

Answered

Unrecognized function or variable 'X'.

fun = @(x,y) exp(-2*x.^4+2*x.^2-x.*y.^1-y.^2) ; fsurf(fun)

Unrecognized function or variable 'X'.

fun = @(x,y) exp(-2*x.^4+2*x.^2-x.*y.^1-y.^2) ; fsurf(fun)

1 day ago | 0

| accepted

Answered

reshaping data properly mesh grid

Let X be your data matrix of size 2000*4. h = X(:,2) ; w = X(:,3) ; nh = length(unique(h)) ; nw = length(unique(w)) ; h ...

reshaping data properly mesh grid

Let X be your data matrix of size 2000*4. h = X(:,2) ; w = X(:,3) ; nh = length(unique(h)) ; nw = length(unique(w)) ; h ...

1 day ago | 1

| accepted

Answered

how to Search the documentation to create a 5-by-7 matrix with normally distributed numbers (instead of uniformly distributed numbers).

Read about randn. https://in.mathworks.com/help/matlab/ref/randn.html

how to Search the documentation to create a 5-by-7 matrix with normally distributed numbers (instead of uniformly distributed numbers).

Read about randn. https://in.mathworks.com/help/matlab/ref/randn.html

1 day ago | 0

| accepted

Answered

how to code a discrete signal

You need to have array x and initial value of y in hand first. Example: x = rand(100,1) ; y0 = rand ; n = length(x) ; y...

how to code a discrete signal

You need to have array x and initial value of y in hand first. Example: x = rand(100,1) ; y0 = rand ; n = length(x) ; y...

1 day ago | 1

Answered

Unrecognized function errors MATLAB

To compare two strings use strcmp. Read about it. prompt = ["input wet or dry:","What value do you want to find [time/thicknes...

Unrecognized function errors MATLAB

To compare two strings use strcmp. Read about it. prompt = ["input wet or dry:","What value do you want to find [time/thicknes...

1 day ago | 0

Answered

How to count the amount of markers in a figure?

x = rand(1, 10000); y = rand(1, 10000); minAllowableDistance = 0.05; numberOfPoints = 50; % Initialize first point. keeperX...

How to count the amount of markers in a figure?

x = rand(1, 10000); y = rand(1, 10000); minAllowableDistance = 0.05; numberOfPoints = 50; % Initialize first point. keeperX...

2 days ago | 0

Answered

How to Terminate a Loop After Reaching the Desired Value?

tol = 10^-5 ; % fix your tolerance value while abs(r(n+1)-r(n))>tol r(n+1)=L*r(n) end

How to Terminate a Loop After Reaching the Desired Value?

tol = 10^-5 ; % fix your tolerance value while abs(r(n+1)-r(n))>tol r(n+1)=L*r(n) end

2 days ago | 1

| accepted

Answered

First 10 Harmonics of Fundamental Frequencies of FFT plot

Use the function findpeaks. Have a look on the function max, sort.

First 10 Harmonics of Fundamental Frequencies of FFT plot

Use the function findpeaks. Have a look on the function max, sort.

2 days ago | 0

Answered

why does the command window show 'Unrecognized function or variable 'beta_est'.'? how to solve it?

Replace the line: syms bets_est; with syms beta_est; By the way you need not to use syms. You can straight away solve usin...

why does the command window show 'Unrecognized function or variable 'beta_est'.'? how to solve it?

Replace the line: syms bets_est; with syms beta_est; By the way you need not to use syms. You can straight away solve usin...

2 days ago | 0

| accepted