Community Profile KSSV

Last seen: Today Active since 2011

Professional Interests: Mathematical Computing

Statistics

All
• • • • • • • • • • • • Content Feed

View by

How to do codind in mfile, for a function defined in an interval [x0, xn] like F(x)=(c1+c2*sin(w1*(x-x(i)))+c3*cos(w2*(x-x(i)))+c4*sin(w2*(x-x(i)))+c5*cos(w1*(x-x(i))))?
% define c1, c2, c2, c4, c5 and W1, W2 etc n = 100 ; x0 = 1 ; xn = 10 ; x = linspace(x0,xn,n) ; F = zeros(n-1,1) ; fo...

environ 15 heures ago | 0

Reading .txt files from the folder and extracting data

environ 15 heures ago | 0

how to plot this ?
As you have a single values, you may plot only a single point. x=5.3; z= 7.8 ; iwant = x*z/(x/z)^2+14*x^2-0.8*z^2 But if y...

environ 17 heures ago | 0

| accepted

Unable to perform assignment because the left and right sides have a different number of elements.
You have not indexed L, so it was 2x1 vector and you are trying to save it into a single element which popped a error. Consider ...

environ 18 heures ago | 0

How to randomly sample a value multiple times from data
Let x,yz be your data. (May be column or matrix) idx = (X-85).^2 + (Y-65).^2 <= 45^2; % get the required indices data of (x...

environ 18 heures ago | 0

How to create a dataset of noisy images
You can add noise using either rand or randn depedning on what kind of noise distribution you want. Or you can blurr your imag...

environ 18 heures ago | 0

how to replace 1 element in matrix
D = A(3,4) % thats it Please don't ask very simple and basic questions in the community. Take a tutorial on basics of MATLAB...

environ 20 heures ago | 0

How can i store the values for each of the 10 iterations of N. i want to store each and every value of the loop.
Note: You have to initialize the arrays x3, y3 L=2; element=10; lambda=1.3; l=lambda/2; X3=[-7.655; 6.534]; Y3=[1.393;-7.0...

environ 20 heures ago | 1

| accepted

currency recognition using image Processing Techniques in matlab
dist is a simple function, this calculates Euclidean distance weight function. You can do it on your own. The Euclidean distan...

environ 20 heures ago | 0

How can i read files inside a folder?
thepath = 'giveyourpathhere' ; files = dir([thepath,filesep,'*.dat']) ; % get .dat files in the folder N = length(files) ; ...

environ 20 heures ago | 0

How to select column 2 in a matrix
A = rand(4,5) ; A2 = A(:,2) % extract second column : this stands for all in this case. The command extract entire row of se...

environ 20 heures ago | 0

| accepted

Find zeros in a large table and replace with average of two previous column values
You can find the zeros using logical indexing or the functon find. Replace those 0 values with NaN and then use the function fi...

1 jour ago | 0

Using loops to perform vector functions
In the function you have given input op which decides wheter to add ot subtract. But you are over writitng the input op inside t...

1 jour ago | 0

reading trivially sorted images 1 by 1 in loop
for i = 1:10 imgName = ['image_',sprintf('%04d',i)] end Also you can consider using the below file exchange function: ht...

2 jours ago | 0

Make scalar data into a vector
a(i)==b(i) gives a logical output i.e. either 0 or 1. If a and b are vectors a == b, gives a logical vector as output having 1 ...

2 jours ago | 0

How to use variable names/strings in a For cycle
You need not to do that.....it is sheer waste of time and not a good coding practise. You can save the data into a 3D matrix. Th...

2 jours ago | 0

| accepted

imagesc or equivalent with datetime as x axis.
times = datetime('now') + hours(0:1:50); yvals = 0:5:100; colors=randn(size(yvals,2),size(times,2)) + yvals'; im=imagesc(co...

2 jours ago | 0

How to return elements of 'A' using indices of 'B' ?
a = thigh_orient_y ; b = shank_orient_y ; idx = main_peak_location ; n = length(idx)-1 ; iwant = cell(n,1) ; for i ...

3 jours ago | 0

| accepted

How to plot different y values for different x values, provided the x and y values are to be generated in a loop?
As you are plotting a point, you need to use marker. n=100; b=6.9; r=5; y=(r-1)+0.5; e=0;z=2; U=9000; figure hold on f...

3 jours ago | 0

How to use logical indexing to return parts of an array that matches the elements of another array?
Read about findpeaks. It will give you the indices and values of peaks; using the indices you can get yopur required values.

3 jours ago | 0

| accepted

How to generate random points in a 3d line, if two end points are known??
A = [ 0, 0, 405] ; B = [ 4.5, -5.5, 480] ; AB = B-A ; % vector t = sort(rand(1,100)) ; % random points % Parametri...

3 jours ago | 0

| accepted

Convert convexhull to stl file
p = [113.6466 111.8984 112.4205 108.7094 113.4748 111.4158 113.5684 ]; q =[ 17.7346 12.7025 16.5175 18.2938 17.43...

3 jours ago | 0

| accepted

Array indices must be positive integers or logical values
t=0:0.1:1; nt = length(t) ; xt = zeros(nt,1) ; for i = 1:length(t) xt(i) = (-0.05)*t(i)^5+0.25*t(i)^4+t(i)+2-exp(-t(i)...

3 jours ago | 0

| accepted

Index in position 2 exceeds array bounds. Index must not exceed 1. Error in metal6 (line 60) M4=[m411(1,j),m412(1,j);m421(1,j),m422(1,j)];
Few of your variables like m212, m312, m412 are scalars i.e. 1x1 size and you are treating them as vectors and extracting more n...

3 jours ago | 0

How to make my quiver plot readable?
You have limited the axes to a large extent. Don't limit the axes. Remove these lines: xlim([0 360]); ylim([0 360]); Let MATL...

3 jours ago | 0

| accepted

Cell-Array operation in large Cell-Array (Vectorization?)

4 jours ago | 1

How to select and plot the maximum point in several pixels
A = rand(4096,104,60) ; B = permute(A,[2 1 3]) ; B_max = max(B,[],3) ; imshow(B_max)

4 jours ago | 0

alignment issue in fprint
P=[65.44; 87.12; 67.46; 79.51]; words1={'Moisture';'Fixed carbon';'Volatile matter';'Ash'}; words2 = repmat({'wt%'},length(P),...

4 jours ago | 1