Answered
How can i imlpement a 2D function on. Matlab
m = 1 ; n = 1 ; if m == 1 && n == -1 h1 = 1 ; elseif m == 0 && n == -1 h1 = 1 ; elseif . . . ...

5 years ago | 0

| accepted

Answered
saving matlab figure without white borders and loss/gain in number of pixels
Use imwrite to write tha image. Read about imwrite.

5 years ago | 0

Answered
How do I change image scale?
If I is your image: I1 = imresize(I,[128 128]) ;

5 years ago | 0

| accepted

Answered
Scatter3 with colorbar assigned to z axis
figure; cmp = linspace(min(z),max(z),numel(z)); scatter3(x,y,z, [], z,'filled'); colorbar; view(-80,15) xlab...

5 years ago | 1

| accepted

Answered
Replace specific rectangular regions with ones
mask = zeros(30,95); load bb.mat bbox = round(bb) ; for i = length(bbox) row1 = ceil(bbox(2)); row2 = row1 + bb...

5 years ago | 1

| accepted

Answered
Flipping a matrix diagonally
A = rand(5) ; n = size(A,1) ; v = A(1:n+1:end) ; A(1:n+1:end) = fliplr(A(1:n+1:end)) Also read about diag.

5 years ago | 0

Answered
Why do I get "Index in position 2 exceeds array bounds"?
It is time to learn debugging a code. https://in.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html . If...

5 years ago | 1

Answered
how to plot graph with cycles
REad about scatter and plot.

5 years ago | 0

Answered
How to fix "Error using == Arrays have incompatible sizes for this operation." in this code?
Error is clear, you are trying to equate arr and mx. Check do they have same dimensions? They have different dimensions that's w...

5 years ago | 1

| accepted

Answered
5x4 colored circle in a grid format
th = linspace(0,2*pi) ; r = 0.1 ; xc = r*cos(th) ; yc = r*sin(th) ; x = 1:5 ; y = 1:4 ; [X,Y] = meshgrid(x,y) ; figur...

5 years ago | 0

Answered
How to --> ca(32,10)='20'
iwant = num2str(A(32,10))

5 years ago | 0

Answered
How to find intersection of several data sets?
Try this: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

5 years ago | 0

Answered
copy element position from one vector to another
a=rand(100,1); a(20:30)=nan; a(60:80)=nan; b=rand(100,1); b(isnan(a)) = NaN ;

5 years ago | 0

Answered
Generation of a pair of random numbers satisfying a constraint
A = sort(rand(1,2))

5 years ago | 0

Answered
how to print plot with title filename
figure() plot(time,BrACOM) xlabel('Time [s]'); ylabel('Acc [g]'); legend('x','y','z'); str = ['Acc Brain COM:' ' ' head ' '...

5 years ago | 0

| accepted

Answered
Generating all Combination of Letters and Numbers
Read about nchoosek and perms.

5 years ago | 1

Answered
MATLAB runtime find function
Read about the function randi.

5 years ago | 0

Answered
Extra NaN value in the results of track or track1
It is not a bug.....if one as multiple seg,ents; how to seperate each segment? Each segment is seperated by NaN. So at the end o...

5 years ago | 0

| accepted

Answered
How to create a vector consisting of repeating 1's and 0's.
A = [1 0] ; n = 10 ; iwant = repmat(A,1,n)

5 years ago | 1

Answered
How to take number between two nested cell arrays
A = {[27,28,30,31],[26,25,30],[33,29,31,27,28]}; B = {[30,64,72,85],[15,33,62],[45,62,77,84,90]}; A = cell2mat(A) ; B = ce...

5 years ago | 0

Answered
How to select area precisely based on latitude and longitude?
REad about inpolygon. If you have the coordinates of the closed polygon you can get the indices lying inside this closed polygon...

5 years ago | 0

Answered
extract contour points belonging to a certain level set
contour should give you the coordinates of the levels mentioned. level = 40 ; [c,h] = contour(X,Y,Z,level) ;

5 years ago | 1

Answered
Iterations in an equation
z = [0:0.1:100] ; nz = length(z) ; for i = 2:n dz = z(n-1)-z(n) end The above can also be achieved using: dz = diff(z)...

5 years ago | 0

Answered
How to i convert complex single into complex double?
Read about the function double. If x is your single signal. x_double = double(x) ;

5 years ago | 0

| accepted

Answered
Why maximum value of array is not present in original array?
To understand this you should read about floating point numbers. You should not use == to equare such numbers. You need to set a...

5 years ago | 0

Answered
Save double vector in matrix in for loop
d_df_mat = zeros(10,5); for j = 1:5 %... a long code with calculations to get the phase shift of two sine %curves % ...

5 years ago | 1

Answered
How to collect the output in a matrix?
n=100; k=2; m=13; A=rand(n,n); A=A+A'; V=rand(n,k); [V,B]=qr(V,0); [n,k]=size(V); Vs=zeros(100,2,m+1); Omegas=zeros(2,2...

5 years ago | 0

Answered
How to split table in new tables
Let T be your table. idx0 = find(strcmp(T.(2),'IGNITION_ON')) ; idx1 = find(strcmp(T.(2),'IGNITION_OFF')) ; T1 = T(idx0(1)...

5 years ago | 0

| accepted

Answered
log plot with multiple y axis
yyaxis left plot(log(rand(1,10))) yyaxis right plot(rand(1,10))

5 years ago | 0

Answered
How to obtain a section from a surf plot
Check this demo example, may be useful. [X,Y,Z] = peaks(100) ; surf(X,Y,Z) xi = unique(X(:)) ; val = 0; dx = 10^-3 ; w...

5 years ago | 0

| accepted

Load more