Community Profile

# KSSV

##### Last seen: Today
7,967 total contributions since 2011

Professional Interests: Mathematical Computing

View details...

Contributions in
View by

Question for directional derivative.
u = @(x1,x2) x1^2-x2^2 ; % derivatives at point (1, 1) x1 = 1 ; x2 = 1 ; % derivatives dudx1 = 2*x1 ; dudx2 = -2*x2 ; ...

4 hours ago | 0

how to stop executing while loop?
You can set a condition like below and exit the while loop. x=1; while x<10 x = x+1 ; end

4 hours ago | 0

Enlarging an image with spline interpolation
I = imread("image.jpeg") ; % assuming image to m*n I=rgb2gray(I); [m,n] = size(I) ; x = 1:n ; y = 1:m ; % Inteprolate to...

9 hours ago | 0

count of non zero elements of a row vector in a loop

10 hours ago | 0

How to print all prime numbers between 1 and 100 using a for loop?
num = 1:100 ; % numbers till 100 idx = isprime(num) ; % get logical indices of prime numebrs num(idx) % print the prime ...

11 hours ago | 1

| accepted

Accepting and rejecting values in numeric array
A = randi(10,10,2) ; % random data for demo % Remove values greater than 8 in column 1 idx = A(:,1)>8 ; % get indices of...

11 hours ago | 0

JPEG Image Compression with a for loop

12 hours ago | 0

Finding distance between values in a column vector
dPeakTime = diff(PeakTime) ; % get the difference between consecutive PEak times AvgPeakDistance = sum(dPeakTime)/numel(dPeakT...

12 hours ago | 0

| accepted

Interpolate NaN on graph

22 hours ago | 0

How to efficiently match the zeros of 1 matrix with another
If D and S are your matrices of size 26*12*160. To repalce zeros in S where D is zero, simply use: idx = D ==0 ; % get indices...

22 hours ago | 0

| accepted

How to modify the code below so it can loop over certain files rather then 1?
csvFiles = dir("*.csv") ; N = length(csvFiles) ; for i = 1:N XY = dlmread(csvFiles(i).name); % [xc,yc,Re,a] = c...

23 hours ago | 1

want to read 38 csv files only first and second column?
csvFiles = dir("*.csv") ; N = length(csvFiles) ; for i = 1:N data = csvread(csvFiles(i).name) ; % also read about xlsre...

24 hours ago | 0

How i can solve the this second order diffrential equation
syms y(x) c w Dy = diff(y,x) ; D2y = diff(Dy,x) ; ode = D2y-(3+2*w)*cot(x)*Dy-2*(1+w)*y==(16/3)*w*(c^2)*(cos(x)^2)+(16/...

1 day ago | 0

plotting map from a matrix
You can use pcolor. Read about it. Also have a look on surf. You can have a look on this package: https://www.eoas.ubc.ca/~ric...

1 day ago | 0

How can I get the secondary diagonal of a matrix?
Read about diag. You can get diagonal elements by using that. A = rand(5) ; diag(A) diag(A,-1) diag(A,1) May be you are lo...

1 day ago | 0

Different assignment of coordinates in meshgrid().
Let A be your 3D matrix. [m,n,p] = size(A) ; [X,Y,Z] = meshgrid(1:p,1:n,1:m) ;

1 day ago | 0

How can I create unique rows in a matrix?
A = [ 0 0 0 3 6 6 4 5 6 4 6 5 5 4 6 5 5 5 5 ...

1 day ago | 0

Figure does not display graph
Replace the lines: plot(x,y,'red') with plot(x,y,'color','red') Make these changes: plot(torque, W,'color', 'blue') %angu...

1 day ago | 1

| accepted

how to create a 3d plot for this matrix
Read about spy. A = randi(10,10) ; A(A>1) = 0 ; spy(A)

1 day ago | 0

How to split sentence?
s = strsplit(cover_str,'.')

2 days ago | 0

| accepted

Error: Unable to perform assignment because the left and right sides have a different number of elements.
This line: y(j)=x(j)+sigma*randn(size(j)); will create error..because, you are trying to save more number of elements then it...

2 days ago | 0

Making the assumption to be the same as results
ro_init=0.2:0.1:100; r = 200 ; c = 200 ; % Try increasing these values B = linspace(0,0.1,r) ; N = linspace(0.8,2,c) ; [B...

2 days ago | 0

| accepted

Selective summary of matrix array

2 days ago | 1

| accepted

The function is fine...there is one typo error..... you should use '=' not '==' function output = findtype(input); [r c] = si...

3 days ago | 0

How to find which curve fit best to another curve

3 days ago | 1

how to write name on plotted graph?
Read about legend. p=[123 456 344 333 667 899 565 546 688 998 765 467] T=[30 45 55 66 77 54 32 34 25 70 12 34] m=[1.00 2.00 2...

3 days ago | 0

How do I allocate one point only in matrix A to its closest point in matrix B
Read about knnsearch. This function will give you the number points you specified which are close. https://in.mathworks.com/he...

4 days ago | 0

Finding the maximum of a vector using only for loop and the routine length
v = [ 1 5 6 23 43 5 2 5 2 23 53 45 6 3 4] ; n = length(v) ; themax = 0 ; pos = 1 ; for i = 1:n if v(i)> themax ...

4 days ago | 0