Answered
Sparse mesh on a surface plot with dense sampling
Plotting the sparse mesh grid over a mesh-free surface won't help me, I want to be able to do this through the properties of the...

4 years ago | 1

| accepted

Answered
Size of vector of abstract symbolic functions
Perhaps this will clarify: syms a b A(t) B(t) c = [a;b]; C=[A;B]; Ct=[A(t);B(t)]; whos c C Ct Basically, symfuns are alw...

4 years ago | 0

Answered
Populate Cells of Structure Array with Empty Tables
This might be what you want: N=3; C=4; T = array2table(zeros(N,10)); [Struc_Array(1:C).a]=deal(T); Struc_Array.a

4 years ago | 0

Answered
How to create a list of matrices??
As I am used to Python I am quite surprised that I can't do it in a simple and obvious way. cell arrays are a close analogue o...

4 years ago | 2

| accepted

Answered
Add a matrix with two columns into another vector based on conditions
One way, using tables: matrix_2={'A',1; 'B',2;'C',3}; matrix_1={ 'B';'C';'D'}; T1=cell2table(matrix_1,'Var',{'Gene'}); T...

4 years ago | 0

| accepted

Answered
failure in user-supplied fitness function evaluation. GA cannot continue. problem based
The error message is complaining that RS(1,:),RS(2,:), or data(i,12) do not contain real values. You should check.

4 years ago | 0

Answered
How can i find the error in the interpolant
fplot(@(x) cosh(x)-p(x))

4 years ago | 0

Answered
Detect all local minimum and remove them
load x&y k=unique(convhull(x,y)); plot(x,y,'--x', x(k),y(k))

4 years ago | 0

Answered
Efficient way to divide array into tiles
Use this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/115340-block-transposition-permutation-and-reshapin...

4 years ago | 1

| accepted

Answered
How can I make the titles line up?
We don't know what you did to create the subplots. However, if you were to create them with tiledlayout, the titles and figure s...

4 years ago | 0

Answered
How to define plane in 3d cube. Intersection point of segment with plane in 3d cube
Use intersectionHull() and addBounds from this FEX download: https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze...

4 years ago | 0

Answered
How to transform a vector to a matrix with same position ?
A=A( ismember(sum(A,2),V) ,:)

4 years ago | 0

| accepted

Answered
The PARFOR loop cannot run due to the way the variable is used
Pre-allocate temporary variables like diff within the parfor loop. parfor permi = 1:npermutations diff=nan(M,N); %pre-al...

4 years ago | 0

| accepted

Answered
Generate a large almost diagonal matrix
N=10; e=ones(N,1); A=spdiags([e,-e],[0,1],N,N); full(A)

4 years ago | 0

Answered
Generate a large almost diagonal matrix
N=10; A=eye(N)-diag(ones(1,N-1),1)

4 years ago | 0

Answered
Find X and Y coordinates of white pixels in a grayscale image
You will first need to get rid of the horizontal line of white pixels near the top, load Image Image(1:20,:)=0; Image=bwprop...

4 years ago | 0

| accepted

Answered
Question about calling user defined function to another script
It returns empty. %r=[-100:0.01:100]; V=10; A_execute1(-100) Don't use global variables. Use anonymous functions, or othe...

4 years ago | 0

| accepted

Answered
Camera Intrinsics for camera 2 not returned by estimateCameraParameters.
Hmmm. It seems like it might be a version-related problem. When I run your code in R2022a, I get intrinsics for both cameras: >...

4 years ago | 0

Answered
How to build a circularly symmetric matrix from a vector
x=discretize(1:100,5); %hypothetical input plot(x); axis padded a=normalize(1:2*numel(x)-1 , 'center'); [~,R]=cart2pol...

4 years ago | 0

Answered
how to count words in a cell array
ca = {{'Let it go'} {'Let it go'} { 'Can''t hold it back anymore'}}; NumWords = cellfun(@(c)sum(c{1}==' ')+1,ca)

4 years ago | 0

Answered
possible to reduce the relative difference for CheckGradients in optimization (fmincon)?
This FEX download allows you to obtain the results of the finite differencing, as well as to decide where (at what x) you want i...

4 years ago | 0

| accepted

Answered
combining varying uneven matrices
N=min(size(A,1), size(B,1)); A=A(1:N,:); B=B(1:N,:);

4 years ago | 0

| accepted

Answered
Compute the mean of a bucket
bins = discretize(A(:,1),5); averages = splitapply(@mean,A(:,2), bins)

4 years ago | 0

Answered
Manipulation of cell to convert into a matrix
Perhaps this is what you want? A = {[5] [1,1,0] ;[4] [0,0]} A_convert = cellfun(@(c) join(string(c),''), A) Or perhaps as fol...

4 years ago | 1

| accepted

Answered
How to color the space between ellipse?
fn=@(r) scale( nsidedpoly(1000,'Radius',r) ,[1,2] ); region=subtract(fn(2),fn(1)); plot(region); axis equal; axis([0,4, 0,...

4 years ago | 0

Answered
Maximal thickness of 3D triangulated part
Use alphaShape on the boundary points of the region. Basically, you would apply alphaShape() with increasingly larger alpha radi...

4 years ago | 0

Answered
How do I extract means for a column based on multiple groups of rows in another column
For such small data sizes, I would splurge and just compute look-up tables of all the moving averages that could possibly be req...

4 years ago | 0

| accepted

Answered
How do I apply an operation to certain elements in a row vector (that are less/more than a given value)
S=0; for k=1:A region1= (0 <= x) & (x <= Va(k)) ; region2= (Vb(k) < x) & (x <= L) & ~region1; Q1 =...

4 years ago | 0

Answered
Question about making a 4-line if statement into a single line
if rand > 0.5, disp('Great indeed!') ; end

4 years ago | 0

| accepted

Answered
Gradient of L2-norm using dlgradient
Why do that, when the gradient is analytically known? function [y, dy] = fun_and_deriv(x,theta) delta=theta-x; y...

4 years ago | 0

| accepted

Load more