Answered

Error vertcat not using vertcat

Your matrix is 10*10 Kx = [407 -169 0 0 0 0 0 0 0 0; -169 331 -162 0 0 0 0 0 0 0; -162 320 -158 0 0 0 0 0 0; % <-----...

Error vertcat not using vertcat

Your matrix is 10*10 Kx = [407 -169 0 0 0 0 0 0 0 0; -169 331 -162 0 0 0 0 0 0 0; -162 320 -158 0 0 0 0 0 0; % <-----...

5 days ago | 0

| accepted

Answered

need help convertig 10 min data interval to 1 minute data interval

You need to do interpolation. Read about interp1 https://in.mathworks.com/help/matlab/ref/interp1.html

need help convertig 10 min data interval to 1 minute data interval

You need to do interpolation. Read about interp1 https://in.mathworks.com/help/matlab/ref/interp1.html

5 days ago | 0

Answered

How to change certain values in a 3 layer matrix and fill in another matrix?

Let NDVI be your 7971*7851*3 matrix. R = NDVI(:,:,1) ; G = NDVI(:,:,2) ; B = NDVI(:,:,3) ; % replace values % repalce each ...

How to change certain values in a 3 layer matrix and fill in another matrix?

Let NDVI be your 7971*7851*3 matrix. R = NDVI(:,:,1) ; G = NDVI(:,:,2) ; B = NDVI(:,:,3) ; % replace values % repalce each ...

7 days ago | 0

Answered

A loop to extract and plot data from a table

Let A be your 10*11 data. x = 0:1:10 ; plot(x,A)

A loop to extract and plot data from a table

Let A be your 10*11 data. x = 0:1:10 ; plot(x,A)

7 days ago | 0

Answered

Selecting only half a row of an array

Read about MATLAB array indexing, instead of asking very simple basic questions. If a is an narray of size 1x5. a(1:2) % gi...

Selecting only half a row of an array

Read about MATLAB array indexing, instead of asking very simple basic questions. If a is an narray of size 1x5. a(1:2) % gi...

7 days ago | 0

| accepted

Answered

Why won't my graph show?

Read about element by element operations. You need to use ./ in the line which shows error. %all of the variables except R0 ar...

Why won't my graph show?

Read about element by element operations. You need to use ./ in the line which shows error. %all of the variables except R0 ar...

7 days ago | 0

| accepted

Answered

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

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

8 days ago | 0

| accepted

Answered

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

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

9 days ago | 0

Answered

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

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

9 days ago | 0

Answered

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', '...

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', '...

9 days ago | 0

| accepted

Answered

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

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

9 days ago | 0

Answered

Write a MATLAB algorithm takes as input the vector x and computes C rowwise

Read about circshift.

Write a MATLAB algorithm takes as input the vector x and computes C rowwise

Read about circshift.

10 days ago | 0

Answered

Assign different symbols to my scatter3 plot.

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

Assign different symbols to my scatter3 plot.

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

10 days ago | 0

Answered

intersection of circle arc and a line

Use this functions: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

intersection of circle arc and a line

Use this functions: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

10 days ago | 0

Answered

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

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

10 days ago | 0

| accepted

Answered

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

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

10 days ago | 0

Answered

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

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

10 days ago | 1

Answered

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,[]) ;

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,[]) ;

10 days ago | 1

Answered

how to generate 10 random numbers ( 0 to 1)

Read about rand. iwant = rand(1,10)

how to generate 10 random numbers ( 0 to 1)

Read about rand. iwant = rand(1,10)

10 days ago | 0

Answered

Use inpolygon command for multiple polygon areas

Refer this: https://in.mathworks.com/matlabcentral/answers/592294-data-picking-from-grid?s_tid=srchtitle

Use inpolygon command for multiple polygon areas

Refer this: https://in.mathworks.com/matlabcentral/answers/592294-data-picking-from-grid?s_tid=srchtitle

10 days ago | 0

| accepted

Answered

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 ;

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 ;

10 days ago | 0

Answered

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

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

10 days ago | 1

| accepted

Answered

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

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

10 days ago | 0

| accepted

Answered

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

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

10 days ago | 0

| accepted

Answered

Value of time on Zero crossing

https://in.mathworks.com/matlabcentral/answers/267222-easy-way-of-finding-zero-crossing-of-a-function

Value of time on Zero crossing

https://in.mathworks.com/matlabcentral/answers/267222-easy-way-of-finding-zero-crossing-of-a-function

10 days ago | 0

Answered

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)

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)

10 days ago | 0

Answered

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.

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.

11 days ago | 0

Answered

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

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

11 days ago | 1

Answered

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

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

11 days ago | 1

| accepted

Answered

Help Needed with looping commands

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

Help Needed with looping commands

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

11 days ago | 0