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

Professional Interests: Mathematical Computing

Answered

Error message saying "Matrix dimensions must agree"

"Matrix dimensions must agree". not too sure why this is. The error is pretty simple. You will get this error, when you try to...

Error message saying "Matrix dimensions must agree"

"Matrix dimensions must agree". not too sure why this is. The error is pretty simple. You will get this error, when you try to...

6 hours ago | 0

Answered

Create matrix with two matrices

A = [1 2 3; 4 5 6;7 8 9] B = [ 11 12 13;14 15 16;17 18 19] m = size(A,1)+size(B,2) ; C = zeros(m,3) ; C(1:2:end,:) = A ; ...

Create matrix with two matrices

A = [1 2 3; 4 5 6;7 8 9] B = [ 11 12 13;14 15 16;17 18 19] m = size(A,1)+size(B,2) ; C = zeros(m,3) ; C(1:2:end,:) = A ; ...

11 hours ago | 1

Answered

Plotting the given Trigonometric functions

x = linspace(-pi,+pi); y = x ; [X,Y] = meshgrid(x,y) ; Z = Y.*sin(2*X)-X.*cos(2*Y) ; surf(X,Y,Z) colorbar

Plotting the given Trigonometric functions

x = linspace(-pi,+pi); y = x ; [X,Y] = meshgrid(x,y) ; Z = Y.*sin(2*X)-X.*cos(2*Y) ; surf(X,Y,Z) colorbar

12 hours ago | 1

Answered

How to to take a value positive of equation

sol = double(x2) ; sol(sign(sol)==1)

How to to take a value positive of equation

sol = double(x2) ; sol(sign(sol)==1)

12 hours ago | 1

| accepted

Answered

Split a data in random partitions

A = rand(100,2) ; n = size(A,1) ; % Get 70% of data random from A m = round(0.7*n) ; % Randomize the data idx = rand...

Split a data in random partitions

A = rand(100,2) ; n = size(A,1) ; % Get 70% of data random from A m = round(0.7*n) ; % Randomize the data idx = rand...

13 hours ago | 0

| accepted

Answered

How to solve an equation

syms x fOut=1/3 m=1 s=1 eqn = fOut -(exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))== 0 ; s = solve(eqn,x)

How to solve an equation

syms x fOut=1/3 m=1 s=1 eqn = fOut -(exp(-0.5*((m-x)/s)^2)/(s*(2*pi)^0.5))== 0 ; s = solve(eqn,x)

14 hours ago | 0

| accepted

Answered

extracting the index of an irregular line on a 2D matrix

Read about ismember. A = rand(10) ; B = A(randperm(100,10)) ; [c,ia] = ismember(A(:),B) ; A(c)

extracting the index of an irregular line on a 2D matrix

Read about ismember. A = rand(10) ; B = A(randperm(100,10)) ; [c,ia] = ismember(A(:),B) ; A(c)

16 hours ago | 0

Answered

All possible combinations of a number of an array

Use this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/69507-npermutek v = 1:3 ; iwant = npermute(v,3)...

All possible combinations of a number of an array

Use this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/69507-npermutek v = 1:3 ; iwant = npermute(v,3)...

19 hours ago | 0

Answered

How to use the method in this article I uploaded to write a program to fit a closed curve？

Attaching an article and uploading your data, you expect us to write a progrma for you? You can have a look on the below toolb...

How to use the method in this article I uploaded to write a program to fit a closed curve？

Attaching an article and uploading your data, you expect us to write a progrma for you? You can have a look on the below toolb...

19 hours ago | 0

Answered

MATLAB cannot integrate trigonometry in the form of degree

Note that at the end, your answer will be in degrees....you can convert it to raidians and check. syms x f = cosd(x); % x is ...

MATLAB cannot integrate trigonometry in the form of degree

Note that at the end, your answer will be in degrees....you can convert it to raidians and check. syms x f = cosd(x); % x is ...

1 day ago | 1

Answered

Operands on table, comparison with numbers

You have to access the columns of Table T using T.(1), T.(2) etc, Read about accessing the columns from tatble. If you have na...

Operands on table, comparison with numbers

You have to access the columns of Table T using T.(1), T.(2) etc, Read about accessing the columns from tatble. If you have na...

1 day ago | 1

Answered

how to plot tangent of y=x^(1/2) at a point x=4 on MATLAB?

It is a MATHS question. You should know the steps of how to follow. Refer it here: https://intl.siyavula.com/read/maths/grade-...

how to plot tangent of y=x^(1/2) at a point x=4 on MATLAB?

It is a MATHS question. You should know the steps of how to follow. Refer it here: https://intl.siyavula.com/read/maths/grade-...

1 day ago | 0

Answered

How to call n numbers from a Matrix

watlevel=[1.8; 1.5; 1.2; 1.3; 1.4; 1.6; 1.7; 1.4; 1.1; 0.9; 0.2; 0.2]; %incoming water level time=[0; 3; 6; 9; 12; 15; 18; 2...

How to call n numbers from a Matrix

watlevel=[1.8; 1.5; 1.2; 1.3; 1.4; 1.6; 1.7; 1.4; 1.1; 0.9; 0.2; 0.2]; %incoming water level time=[0; 3; 6; 9; 12; 15; 18; 2...

1 day ago | 1

| accepted

Answered

How to know which plot is more linear then the other?

How about finding the area bounded by the curves..which ever has least area is straight. A = [0 0.423891532 0.819380304 1.2...

How to know which plot is more linear then the other?

How about finding the area bounded by the curves..which ever has least area is straight. A = [0 0.423891532 0.819380304 1.2...

1 day ago | 0

Answered

Matrix "User Define"

What you gave is a combination of numbers and strings.....this cannot be acieved by a matrix. But you can use cell arrays for th...

Matrix "User Define"

What you gave is a combination of numbers and strings.....this cannot be acieved by a matrix. But you can use cell arrays for th...

2 days ago | 0

Answered

Solve the equation for x

Repalce exp.^() with smply: exp() Also element by element operation not reuqired: fun = p* exp(-exp((v-x)/a)) + r* exp(-((...

Solve the equation for x

Repalce exp.^() with smply: exp() Also element by element operation not reuqired: fun = p* exp(-exp((v-x)/a)) + r* exp(-((...

2 days ago | 2

| accepted

Answered

How to get X and Y coordinates from a Sparse Matrix?

If A is your sparse matrices. You can get positions using: [y,x] = find(A) ; % x, y are the positons/indices of non-zeros ...

How to get X and Y coordinates from a Sparse Matrix?

If A is your sparse matrices. You can get positions using: [y,x] = find(A) ; % x, y are the positons/indices of non-zeros ...

2 days ago | 0

| accepted

Answered

Index exceeds the number of array elements (1).

The error is clear...you are trying to extract more number of elements than present int he array. A = rand(1,10) ; A(1) %...

Index exceeds the number of array elements (1).

The error is clear...you are trying to extract more number of elements than present int he array. A = rand(1,10) ; A(1) %...

3 days ago | 0

Answered

Plot exactly root of polynomial degree=3

p = [1 -1 0 -10] ; % polynomial coefficients r = roots(p) ; % get roots %% plot x = linspace(0,10); y = polyval(p...

Plot exactly root of polynomial degree=3

p = [1 -1 0 -10] ; % polynomial coefficients r = roots(p) ; % get roots %% plot x = linspace(0,10); y = polyval(p...

3 days ago | 0

Answered

How to vectorize matrix assignment process below

Read about sub2ind. Convert your sub indices into global indices and use. idx = sub2ind(size(A),2*i-1,2*i-1) ; A(idx) = a(i) ...

How to vectorize matrix assignment process below

Read about sub2ind. Convert your sub indices into global indices and use. idx = sub2ind(size(A),2*i-1,2*i-1) ; A(idx) = a(i) ...

3 days ago | 1

| accepted

Answered

How to calculate the value of the vector A in equation AXA' = b?

syms x y A = [x y] ; X = rand(2) ; b = rand ; eqn1 = A*X*X'- b ==0 s = solve(eqn1,x,y) ; x = double(s.x) y = double...

How to calculate the value of the vector A in equation AXA' = b?

syms x y A = [x y] ; X = rand(2) ; b = rand ; eqn1 = A*X*X'- b ==0 s = solve(eqn1,x,y) ; x = double(s.x) y = double...

3 days ago | 0

| accepted

Answered

Generating 2D Geometry with MATLAB and Exporting to FEM software

Yes it is very much possible.. but you need to enter the details of FEA/ FEM mesh in the format which software demands. Already ...

Generating 2D Geometry with MATLAB and Exporting to FEM software

Yes it is very much possible.. but you need to enter the details of FEA/ FEM mesh in the format which software demands. Already ...

3 days ago | 0

Answered

need help with writing a script that will solve the problem here is what i started with

Hints: x = linspace(0,1,100); y = linspace(0,1,100) ; [X,Y] = meshgrid(x,y) ; Z = X.^2+Y.^2 ; surf(X,Y,Z) shading interp ...

need help with writing a script that will solve the problem here is what i started with

Hints: x = linspace(0,1,100); y = linspace(0,1,100) ; [X,Y] = meshgrid(x,y) ; Z = X.^2+Y.^2 ; surf(X,Y,Z) shading interp ...

3 days ago | 1

Answered

How can I read multiple mat files and perform ttest2 function?

This question has been discussed to death. A simple search will give you lot of links. matFiles = dir('*.mat') ; N = length(...

How can I read multiple mat files and perform ttest2 function?

This question has been discussed to death. A simple search will give you lot of links. matFiles = dir('*.mat') ; N = length(...

3 days ago | 0

Answered

how do i write a matlab script to sum this expression?

N = 100; thesum = 0 ; for i = 1:N thesum = thesum+(1/i+1/((i+2)*(i+3))) ; end Without Loop: N = 100 ; f = @(i) (1....

how do i write a matlab script to sum this expression?

N = 100; thesum = 0 ; for i = 1:N thesum = thesum+(1/i+1/((i+2)*(i+3))) ; end Without Loop: N = 100 ; f = @(i) (1....

4 days ago | 1

| accepted

Answered

how to find argmin to this vector

Are you looking for something like this? Let a,b be your column matrices. [a,b] = meshgrid(a,b) ; % make them a matrix F ...

how to find argmin to this vector

Are you looking for something like this? Let a,b be your column matrices. [a,b] = meshgrid(a,b) ; % make them a matrix F ...

4 days ago | 0

| accepted

Answered

How to Swap Column according to odd/even numbers?

This is basic in MATLAB. You should read about indexing an array. Example: A = rand(10,1) ; % array for demo E = A(2:2:end...

How to Swap Column according to odd/even numbers?

This is basic in MATLAB. You should read about indexing an array. Example: A = rand(10,1) ; % array for demo E = A(2:2:end...

4 days ago | 0

Answered

How to get the Z-contour values related to scatter positions?

Read about ScatteredInterpolant.

How to get the Z-contour values related to scatter positions?

Read about ScatteredInterpolant.

4 days ago | 0

Answered

Given that a=[1;4.2;3;pi;8;7;62;50;23;17]; Please use vector b to represent all the even elements in vector a (b=[8;62;50])?

Use mod to get your even numbers. a = [1; 4.2; 3; pi; 8; 7; 62; 50; 23; 17]; idx = mod(a,2) ; iwant = a(idx==0)

Given that a=[1;4.2;3;pi;8;7;62;50;23;17]; Please use vector b to represent all the even elements in vector a (b=[8;62;50])?

Use mod to get your even numbers. a = [1; 4.2; 3; pi; 8; 7; 62; 50; 23; 17]; idx = mod(a,2) ; iwant = a(idx==0)

4 days ago | 0