Community Profile

# KSSV

##### Last seen: Today
7 980 total contributions since 2011

Professional Interests: Mathematical Computing

View details...

Contributions in
View by

Lagrange polynomial giving me Inf in final form
% clc; clear all ; sp = [30 45 60 75 90 120]; mb = [2 4 9 17 27 82]; n=length(sp)-3; syms x; Q = 0; for i = 1:n+1 M =...

26 minutes ago | 0

A script containing if then statements

environ 12 heures ago | 0

Plotting of error vs iteration number matlab
clear all; clc ; close all; %Setting up the parameters dx=0.1 ; dy = dx ; Lx=1 ; Ly =1; x = (0:dx:Lx); y = (0:dy:Ly); Nx=le...

environ 12 heures ago | 0

| accepted

How to Check if array has multiples of a value and how to replace those values that are multiples with a certain assigned values
If A is your matrix. idx = mod(A,8)==0 ; % get indices which are divisible by 8 A(idx) = -6 ; % repalce the values

environ 13 heures ago | 0

| accepted

Need to erease all the rows of a matrix where a zero appears
A = [0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 1 0 0 ...

environ 13 heures ago | 0

| accepted

How to solve an ODE with ode45 in a parfor loop?
[t(:,i), S(:,i)] = ode45(@(t,s) fn(t,s,fg_vars),tspan,inital_conds) In the above t will be a column vector and S will be a colu...

environ 18 heures ago | 0

How to use for loop compare all values in a 2x2 matrix?
It is your home work...so you have to do it yourself. Follow the below hints. You can get the dimensions/ size of a matrix usi...

environ 18 heures ago | 0

| accepted

Import entire row instead of range from excel

environ 21 heures ago | 0

| accepted

how to locate bin center at appropriate integer value?
h = histogram(LH) ; h Now h has all the information you want. Pick the one you want.

environ 22 heures ago | 0

How to extract data?
A = rand(181,91) ; iwant = A(:,1:19) ;

environ 22 heures ago | 0

| accepted

2D and 3D graphs
Try this: num = xlsread("Test1.xlsx") ; [r,c] = size(num'); n = r/9; % Arrange the data A = permute(reshape(num,[c,r/n...

1 jour ago | 0

| accepted

i need help (matlab)

1 jour ago | 0

sorting table according to date/time
Convert the dates you have into class of datetime using the function datetime and then you can use sort function. Read about dat...

1 jour ago | 0

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 ; ...

2 jours 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

2 jours 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...

2 jours ago | 0

| accepted

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

2 jours 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 ...

2 jours 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...

2 jours ago | 0

JPEG Image Compression with a for loop

2 jours 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...

2 jours ago | 0

| accepted

Interpolate NaN on graph

3 jours 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...

3 jours 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) ; C = zeros(N,3) ; for i = 1:N XY = dlmread(csvFiles(i).name); [x...

3 jours 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...

3 jours 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/...

3 jours 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...

3 jours 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...

3 jours ago | 0