maximum value of matrix
[val,idx] = max(A(:)) ; A(idx,:)

Find datetime in a vector
Use ismember Or idx = knnsearch(datenum(t_ref),datenum(t1)) ; t_ref(idx) t1 Or dt = abs((datenum(t_ref)-datenum(t1))) ;...

| accepted

convert block cell to image
Let I be your 8*8 cell block .. iwant = cell2mat(I) ;

Moving a Polygon on a Polygon
pgon = polyshape([440 0 0 440], [0 0 5.1 5.1]); path = [1:5:100 100:-5:1] ; for i = path pgon2 = polyshape([18 0 0 18]+i...

| accepted

How do I solve backslash issue in this case?
Replace this line: filename = strcat(selpath,imageFolder(i).name); with: filename = fullfile(selpath,imageFolder(i).name); I...

| accepted

"Warning: Name is nonexistent or not a directory: " Error Message if I enter the path of a file I want to import
thepath = '' ; % copy your path here in quotations filename = '' ; % give your file name in quotations with extension the...

| accepted

Finding location of minimum in 3d array
It is asked multiple times..you may search in the forum. For EXample: https://in.mathworks.com/matlabcentral/answers/52341-min...

| accepted

Save and load matrix. Size problem
Check M1 might be a structure......try size(M1.Mat1)

| accepted

How to smooth a surface of 3-d geometry
Are you looking for something like this? dt = delaunayTriangulation(Xm,Ym) ; t = dt.ConnectivityList ; x = dt.Points(:,...

Ouputting all the permutations with repeated symbols in MATLAB
Read about perms. After this, you can try unique and get the required output. str = 'Mississippi' ; S = perms(str) ; iwa...

| accepted

running a code on all columns
Y = rand(1000,100) ; iwant = zeros(20,50,100) ; for i = 1:100 Y1 = Y(:,i) ; S1 = numel(Y1); % this is same alway...

| accepted

WHEN I DO INVERSE OF MY MATRIX IT GIVE VERY LARGE VALUE AND MULTIPLICATION OF (inv(H).*J) GIVE INCORRECT VALUE. can you resolve it
YOur H is a rank deficeint matrix...check rank(H) rank of H is 2. Also check it's determinant is zero. So you have only two i...

Saving animation of projectile motion

Levelling of 3D built in stl file

could you please tell me how to plot 2 objects with different velocity
close all; clc; vA = [2.31; -0.55]; % initial velocity OF 1 vB = [2.31; -0.55]; % initial velocity OF 1 dt = 0.1; ...

| accepted

How to create 3D interpolated surface from separate lines in different arrays
Join all the points you have into a matrix of size n*3..i.e in the form (x,y,z). Not you have scattered data in hand. Do interpo...

If I have two 2-D datasets with identical dimension sizes, how can I filter data from one at certain gridpoints where the other dataset meets a certain condition?
A = randi([1 5],5,5) ; % shapes B = rand(5) ; % data [c,ia,ib]= unique(A) ; N = length(c) ; % GEt max values ...

| accepted

Computing the optimal split dimension of an image.

Nearest neighbor distribution and spherical contact distribution

Use intersect function in model
[same,ia,ib] = intersect(a,b,'rows') ; a(sort(ia),:)

How to overcome this problem; Error using - Matrix dimensions must agree.
Two options: Reduce dimensions psi = psi(1:101,1:108) ; p = p(1:101,1:108) ; En =sqrt(((psi-p)^2)/psi^2); Do interpolat...

| accepted

How to solve "Subscripted assignment dimension mismatch"?
What the necessity to save those images into a bigger image? USe montage. Read about it.

How to plot Date on x axis and string on Y axis. Text annonation on Data points
Load data from excel to matlab using xlsread. Use this to use labels along the axes: https://in.mathworks.com/help/matlab/cre...

How to calculate post-pre connectivity matrices for multiple subjects
postfiles = dir('*post*.mat') ; m = length(postfiles) ; prefiles = dir('*pre*.mat') ; n = length(prefiles) ; post = zeros(51...

Draw a circle and measure the white pixels area inside
I = imread('image.png') ; I1 = rgb2gray(I) ; [y,x] = find(I1) ; length(x)

To crate a 2D lookup table with interpolation for matrix data and to crate a function of (x,y) (inputs) give the output from the matrix
Read about interp2. n = 20 ; Z = peaks(n) ; [X,Y] = meshgrid(1:n,1:n) ; [Xi,Yi] = meshgrid(1:0.1:n,1:0.1:n) ; Zi = i...

how I can get Px,Py and Pz value ?
%% %Given Theta_1 =45; Theta_2 =10; Theta_3 =0; Theta_4 =90; Theta_5 =0; Theta_6 =45; %known a1 = 0.35; a3 = 0.3; a4 ...

| accepted

How to convert a table into a structure

How can I select data in a pcolor plot by using a rectangle?
Read about interp2. Fix your (Xi,Yi) for which you want to extract the data and use interp2. Something like below: xi = lin...