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

2 months ago | 0

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

2 months ago | 0

| accepted

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

2 months ago | 0

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

2 months ago | 1

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

2 months ago | 2

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

2 months ago | 0

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

2 months ago | 0

| accepted

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

2 months ago | 1

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

Saving animation of projectile motion

2 months ago | 0

Levelling of 3D built in stl file

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

| accepted

Computing the optimal split dimension of an image.

2 months ago | 0

Nearest neighbor distribution and spherical contact distribution

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

| accepted

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

2 months ago | 0

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

2 months ago | 0

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

2 months ago | 0

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

3 months ago | 0

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

3 months ago | 1

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

3 months ago | 1

| accepted

How to convert a table into a structure

3 months ago | 0

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

3 months ago | 0