Community Profile

# KSSV

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

Professional Interests: Mathematical Computing

View details...

Contributions in
View by

error using fprintf function
You have to specify a format specifier. A = 1000000000; B = A / 512; fprintf('%f\n',B); % %f is for floating point numbe...

14 hours ago | 0

| accepted

why i get this error
Your image seems to be a RGB image. You have to use imhist on a 2D matrix. Not 3D image. R = i(:,:,1) ; G = i(:,:,2) ; B = i...

1 day ago | 0

To store Output of a user defined function in an array
If you want to call function n times and if function gives on output, to store the utput in array: B = zeros(n,1) ; for i= 1:...

1 day ago | 0

Can I assign elements of one cell array to multiple elements of another cell array without a loop?
myArray = {'One', 1000; 'Two', 2000; 'Three', 3000; 'Four', 4000; 'One', 5000; 'Five', 6000}; anotherArray = [({'One', 'Two', '...

1 day ago | 0

| accepted

Error using Quiver function
You cannot use like that. You need to take all data in double i.e in numbers to plot the arrows.Something like below: [X,Y] = m...

2 days ago | 0

Assign different symbols to my scatter3 plot.
REad about gscatter. Or You have to assign different markers based on Z and plot.

2 days ago | 0

intersection of circle arc and a line
Use this functions: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

2 days ago | 0

How to go through each element of a vector without a for loop
If P is an array of coefficients and x is the value n = length(p)-1 ; iwant = sum(p.*x.^(n:-1:0)) If x is an column array i...

2 days ago | 0

| accepted

how to stop overwriting results of a for loop in an array
clear,clc load LAnkle_tracking.mat plot(LAnkle(:,1),LAnkle(:,4),'k.') y=zeros(1,length(LAnkle)); for i=2:length(LAnkle)-1 ...

2 days ago | 0

Compare experimental and simulated image to estimate error
Let I1 be your experimental image, I2 be your simulated image. [m,n,p] = size(I1) ; I2_resize = imresize(I2,[m n]) ; dI = ...

2 days ago | 1

Element-wise multiplication of a 3D matrix KxLxM by a 1D vector M
Anew = reshape(A,K*L,[]) ; Cnew = Anew.*B' ; Cnew = reshape(Cnew,K,L,[]) ;

2 days ago | 0

how to generate 10 random numbers ( 0 to 1)

3 days ago | 0

Use inpolygon command for multiple polygon areas

3 days ago | 0

| accepted

How can I apply a condition on a culumn?
Let A be your array. idx = A>360 ; A(idx) = A(idx)-360 ; idx = A<360 ; A(idx) = A(idx)+360 ;

3 days ago | 0

Index exceeds the number of array elements (1).
Repalce with this the for loop. for i=2:length(x_rec) xhat(i)= d1+d2*x_rec(i-1)+d3*y_rec(i-1)+d4*x_rec(i-1)*y_rec(i-1)+d5...

3 days ago | 0

| accepted

elemental subtraction indices of initial vector
A = [1 2 1 2 2 3 4 5] ; T = A-A.' ; x = 0 ; idx = T == x ; % get logical indices [r,c] = ind2sub(size(T),find(idx)) % ge...

3 days ago | 0

| accepted

How to plot different matrices in a cell with different marker styles
S = {'-*r', '-ok','-dr','-.b'} ; for i = 1:4 C{i} = rand(10,1) ; end % plot figure hold on for i = 1:4 plot(C{i},S{...

3 days ago | 0

Value of time on Zero crossing

3 days ago | 0

i want to write a code where equation is y=x*x. if y=100 what is the value of x?
z = 100 ; x = 1:20 ; y = x.^2 ; y(x==z)

3 days ago | 0

How to save X, Y coordinates from different cells in multiples files
Let SX and SY be your cells. iwant = [ [SX{:}] [SY{:}]] ; Also read about Cell2mat, cat.

3 days ago | 0

Error using Polyfit: The first two inputs must have the same number of elements. The x can have multiple inputs as columns?
Your x is a m*6 array and y is a m*1..It is not allowed. That is why you got error. Run a loop and use polyfit for each column...

4 days ago | 1

Plotting multiple 2D metrices
Two options: % If each matrix has two curves figure plot(A') hold on plot(B') % If each matrix has (x,y) coordinates fig...

4 days ago | 1

| accepted

Help Needed with looping commands
Just use: E = d(:,1)-c(:,2) ; You need not to use a loop.

4 days ago | 0

Finding minima in data as well as values near it

4 days ago | 0

Resultant curve of two variables
Y = Y1+Y2 ;

4 days ago | 0

Storing output into a matrix for plotting
I expect rho is bein gused in the lines which are not shown...so repalce rho inside the loop with rho(i). N = 5000; Rmax = 50;...

4 days ago | 1

| accepted

How to interpolate the matrix A ?
If you want to go ahead with NaN's itself...use intepr2, imresize. If you want to fill NaN's first, then use fillmissing and t...

4 days ago | 0

| accepted

how can i call and plot function of two variables ?
Define x1 and x2 using linspace. Make x1, x2 matrices, using meshgrid. Make your caclulation. You need to use element by ele...

4 days ago | 0

| accepted